﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IQKS.AWP.BusinessAccessLayer;
using IQKS.AWP.BusinessObject;
using System.IO;
using System.Configuration;
using System.Text.RegularExpressions;

public partial class Admin_CandidateBriefDetailsAuditor : System.Web.UI.Page
{
    #region events
    public string DocumentPath = ConfigurationSettings.AppSettings["ProfilePic"];
    public string CVPath = ConfigurationSettings.AppSettings["CvPath"];

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            hdnBriefID.Value = CommonUtility.Decrypt(Convert.ToString(Request.QueryString["BriefID"]),true);
            hdnCandidateID.Value =  CommonUtility.Decrypt(Convert.ToString(Request.QueryString["CandidateID"]),true);
            hdnCandidateBriefId.Value = "0";
            hdnCandidateQueryID.Value = "0";
            hdnMoreQueryID.Value = "0";
            //BindGrid();
            LoadPageView(sender, e);
            LoadBindData(sender, e);
            mainMenu_MenuItemClick(sender, null);

            //ddlGroupDiscussiontype



        }
        // btnRLADD.Attributes.Add("onclick", "javascript:return confirm('Please Confirm to you want submit your Review -   ..')");
    }

    private void LoadPageView(object sender, EventArgs e)
    {

        string StatusID = CommonUtility.Decrypt(Convert.ToString(Request.QueryString["statusid"]), true);

        if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RAM")
        {
            tblModerator.Visible = true;
            tblModeratorGrid.Visible = false;
            lblMReviewDocument.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);
            mvwCandidateBriefDetails.ActiveViewIndex = 7;
            rbMQuestionNo.Checked = true;
            rbQuestionNo_CheckedChanged(sender, null);

            mainMenu.Items.Remove(mainMenu.Items[12]);
            mainMenu.Items.Remove(mainMenu.Items[11]);
            mainMenu.Items.Remove(mainMenu.Items[10]);
            mainMenu.Items.Remove(mainMenu.Items[9]);
            mainMenu.Items.Remove(mainMenu.Items[8]);
        }
        else if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RARL")
        {


            if (StatusID == "27")
            {

                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;

                lblMReviewDocument.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);
                mvwCandidateBriefDetails.ActiveViewIndex = 7;
                rbMQuestionNo.Checked = true;
                rbQuestionNo_CheckedChanged(sender, null);

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
            }
            else
            {

                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;

                tblResearchLead.Visible = true;
                tblResearchLeadGrid.Visible = false;

                lblRLReviewDocument.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);
                rbRLNo.Checked = true;
                rbRLNo_CheckedChanged(sender, null);

                rbReviewDocYes_CheckedChanged(sender, null);
                mvwCandidateBriefDetails.ActiveViewIndex = 8;

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
            }


        }
        else if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "AD")
        {
            if (StatusID == "28")
            {
                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;

                tblAuditor.Visible = true;
                tblAuditorGrid.Visible = false;
                lblAuditorReview.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);
                rbRLQuesNo.Checked = true;
                rbRLQuesNo_CheckedChanged(sender, null);
                mvwCandidateBriefDetails.ActiveViewIndex = 8;
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
            }
            else if (StatusID == "29")
            {
                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;
                tblAuditor.Visible = true;
                tblAuditorGrid.Visible = false;
                lblAuditorReview.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);
                rbRLQuesNo.Checked = true;
                rbRLQuesNo_CheckedChanged(sender, null);
                mvwCandidateBriefDetails.ActiveViewIndex = 9;
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
            }
            else
            {

                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;
                tblAuditor.Visible = true;
                tblAuditorGrid.Visible = false;
                lblAuditorReview.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);
                rbRLQuesNo.Checked = true;
                rbRLQuesNo_CheckedChanged(sender, null);
                mvwCandidateBriefDetails.ActiveViewIndex = 9;
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
            }


        }
        else if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IE")
        {
            if (StatusID == "5")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);
                mainMenu.Items.Remove(mainMenu.Items[3]);
                mvwCandidateBriefDetails.ActiveViewIndex = 1;
            }
            else if (StatusID == "6")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);
                mvwCandidateBriefDetails.ActiveViewIndex = 2;
            }
            else if (StatusID == "7")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mvwCandidateBriefDetails.ActiveViewIndex = 3;
            }
            else if (StatusID == "8")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mvwCandidateBriefDetails.ActiveViewIndex = 4;
            }
            else if (StatusID == "9")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mvwCandidateBriefDetails.ActiveViewIndex = 5;

            }
            else if (StatusID == "10" || StatusID == "11" || StatusID == "27")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);

                mvwCandidateBriefDetails.ActiveViewIndex = 7;

            }
            else if (StatusID == "12" || StatusID == "13" || StatusID == "28")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);

                mvwCandidateBriefDetails.ActiveViewIndex = 8;

            }
            else if (StatusID == "14" || StatusID == "15" || StatusID == "29")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mvwCandidateBriefDetails.ActiveViewIndex = 10;

            }
            else if (StatusID == "16" || StatusID == "17" || StatusID == "30")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);

                mvwCandidateBriefDetails.ActiveViewIndex = 10;

            }
            else if (StatusID == "18" || StatusID == "19")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);

                mvwCandidateBriefDetails.ActiveViewIndex = 11;

            }
            else if (StatusID == "20" || StatusID == "21")
            {

                mvwCandidateBriefDetails.ActiveViewIndex = 12;

            }
            else if (StatusID == "24")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mvwCandidateBriefDetails.ActiveViewIndex = 6;
            }
            else
            {
                mvwCandidateBriefDetails.ActiveViewIndex = 12;

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
            }


            if (StatusID == "29")
            {
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mvwCandidateBriefDetails.ActiveViewIndex = 9;

                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;

                tblAuditor.Visible = false;
                tblAuditorGrid.Visible = true;
                tblIE.Visible = true;
                tblIEGrid.Visible = false;

                lblIEReviewDocument.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);

                rbIEQuestionNo.Checked = true;
                rbIEQuestionNo_CheckedChanged(sender, null);
            }
            else if (StatusID == "30")
            {

                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;

                tblAuditor.Visible = false;
                tblAuditorGrid.Visible = true;
                tblIE.Visible = true;
                tblIEGrid.Visible = false;

                lblIEReviewDocument.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);

                rbIEQuestionNo.Checked = true;
                rbIEQuestionNo_CheckedChanged(sender, null);
            }
            else
            {
                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;

                tblAuditor.Visible = false;
                tblAuditorGrid.Visible = true;
                tblIE.Visible = true;
                tblIEGrid.Visible = false;

                lblIEReviewDocument.InnerText = "* Acceptable file formats " + Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"]).Replace("|", ",") + Convert.ToString(ConfigurationManager.AppSettings["FileSize"]);

                rbIEQuestionNo.Checked = true;
                rbIEQuestionNo_CheckedChanged(sender, null);
            }

        }
        else if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RD")
        {
            if (Request.QueryString["CandQuestion"] != null)
            {
                if (Convert.ToString(Request.QueryString["CandQuestion"]) == "1")
                {
                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mainMenu.Items.Remove(mainMenu.Items[7]);
                    mainMenu.Items.Remove(mainMenu.Items[6]);
                    mainMenu.Items.Remove(mainMenu.Items[5]);
                    mainMenu.Items.Remove(mainMenu.Items[4]);
                    mainMenu.Items.Remove(mainMenu.Items[3]);
                    mainMenu.Items.Remove(mainMenu.Items[2]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 1;
                }
            }
            else
            {

                if (StatusID == "5")
                {

                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mainMenu.Items.Remove(mainMenu.Items[7]);
                    mainMenu.Items.Remove(mainMenu.Items[6]);
                    mainMenu.Items.Remove(mainMenu.Items[5]);
                    mainMenu.Items.Remove(mainMenu.Items[4]);
                    mainMenu.Items.Remove(mainMenu.Items[3]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 1;
                }
                else if (StatusID == "6")
                {

                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mainMenu.Items.Remove(mainMenu.Items[7]);
                    mainMenu.Items.Remove(mainMenu.Items[6]);
                    mainMenu.Items.Remove(mainMenu.Items[5]);
                    mainMenu.Items.Remove(mainMenu.Items[4]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 2;
                }
                else if (StatusID == "7")
                {

                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mainMenu.Items.Remove(mainMenu.Items[7]);
                    mainMenu.Items.Remove(mainMenu.Items[6]);
                    mainMenu.Items.Remove(mainMenu.Items[5]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 3;
                }
                else if (StatusID == "8")
                {

                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mainMenu.Items.Remove(mainMenu.Items[7]);
                    mainMenu.Items.Remove(mainMenu.Items[6]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 4;
                }
                else if (StatusID == "9")
                {


                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mainMenu.Items.Remove(mainMenu.Items[7]);
                    mainMenu.Items.Remove(mainMenu.Items[6]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 5;

                }
                else if (StatusID == "10" || StatusID == "11" || StatusID == "27")
                {


                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);

                    mvwCandidateBriefDetails.ActiveViewIndex = 7;

                }
                else if (StatusID == "12" || StatusID == "13" || StatusID == "28")
                {


                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);

                    mvwCandidateBriefDetails.ActiveViewIndex = 8;

                }
                else if (StatusID == "14" || StatusID == "15" || StatusID == "29")
                {


                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);

                    mvwCandidateBriefDetails.ActiveViewIndex = 9;

                }
                else if (StatusID == "16" || StatusID == "17" || StatusID == "30")
                {
                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 11;
                }
                else if (StatusID == "18" || StatusID == "19")
                {
                    mainMenu.Items.Remove(mainMenu.Items[12]);

                    mvwCandidateBriefDetails.ActiveViewIndex = 11;

                }
                else if (StatusID == "20" || StatusID == "21")
                {
                    mvwCandidateBriefDetails.ActiveViewIndex = 12;

                }
                else if (StatusID == "24")
                {

                    mainMenu.Items.Remove(mainMenu.Items[12]);
                    mainMenu.Items.Remove(mainMenu.Items[11]);
                    mainMenu.Items.Remove(mainMenu.Items[10]);
                    mainMenu.Items.Remove(mainMenu.Items[9]);
                    mainMenu.Items.Remove(mainMenu.Items[8]);
                    mvwCandidateBriefDetails.ActiveViewIndex = 6;
                }

                else
                {

                    mvwCandidateBriefDetails.ActiveViewIndex = 11;
                    mainMenu.Items.Remove(mainMenu.Items[12]);
                }
            }
            if (StatusID == "30")
            {
                mainMenu.Items.Remove(mainMenu.Items[11]);

                mvwCandidateBriefDetails.ActiveViewIndex = 10;
                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;
                tblAuditor.Visible = false;
                tblAuditorGrid.Visible = true;
                tblIE.Visible = false;
                tblIEGrid.Visible = true;
                tbRegional.Visible = true;
                tblRegionalGrid.Visible = false;
                tblGDGrid.Visible = false;
                tbGlobal.Visible = true;
                rbRdNo.Checked = true;
                rbRdNo_CheckedChanged(sender, null);

            }
            else
            {
                tblModerator.Visible = false;
                tblModeratorGrid.Visible = true;
                tblResearchLead.Visible = false;
                tblResearchLeadGrid.Visible = true;
                tblAuditor.Visible = false;
                tblAuditorGrid.Visible = true;
                tblIE.Visible = false;
                tblIEGrid.Visible = true;
                tbRegional.Visible = true;
                tblRegionalGrid.Visible = false;
                tblGDGrid.Visible = false;
                tbGlobal.Visible = true;
                rbRdNo.Checked = true;
                rbRdNo_CheckedChanged(sender, null);
            }

        }
        else if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "GD")
        {
            if (StatusID == "5")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);
                mainMenu.Items.Remove(mainMenu.Items[3]);
                mainMenu.Items.Remove(mainMenu.Items[2]);
                mvwCandidateBriefDetails.ActiveViewIndex = 1;
            }
            else if (StatusID == "6")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);
                mainMenu.Items.Remove(mainMenu.Items[3]);

                mvwCandidateBriefDetails.ActiveViewIndex = 2;
            }
            else if (StatusID == "7")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);

                mvwCandidateBriefDetails.ActiveViewIndex = 3;
            }
            else if (StatusID == "8")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mvwCandidateBriefDetails.ActiveViewIndex = 4;
            }
            else if (StatusID == "9")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);

                mvwCandidateBriefDetails.ActiveViewIndex = 5;

            }
            else if (StatusID == "10" || StatusID == "11" || StatusID == "27")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);

                mvwCandidateBriefDetails.ActiveViewIndex = 7;

            }
            else if (StatusID == "12" || StatusID == "13" || StatusID == "28")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);

                mvwCandidateBriefDetails.ActiveViewIndex = 8;

            }
            else if (StatusID == "14" || StatusID == "15" || StatusID == "29")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);

                mvwCandidateBriefDetails.ActiveViewIndex = 9;

            }
            else if (StatusID == "16" || StatusID == "17" || StatusID == "30")
            {


                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);

                mvwCandidateBriefDetails.ActiveViewIndex = 10;

            }
            else if (StatusID == "18" || StatusID == "19")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);

                mvwCandidateBriefDetails.ActiveViewIndex = 11;

            }
            else if (StatusID == "20" || StatusID == "21")
            {

                mvwCandidateBriefDetails.ActiveViewIndex = 12;

            }
            else if (StatusID == "24")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mvwCandidateBriefDetails.ActiveViewIndex = 6;
            }
            else
            {
                mvwCandidateBriefDetails.ActiveViewIndex = 12;

            }

            tblModerator.Visible = false;
            tblModeratorGrid.Visible = true;
            tblResearchLead.Visible = false;
            tblResearchLeadGrid.Visible = true;
            tblAuditor.Visible = false;
            tblAuditorGrid.Visible = true;
            tblIE.Visible = false;
            tblIEGrid.Visible = true;
            tbRegional.Visible = false;
            tblRegionalGrid.Visible = true;
            tblGDGrid.Visible = false;
            tbGlobal.Visible = true;

            rdGdNo.Checked = true;
            rdGdNo_CheckedChanged(sender, null);

        }
        else if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IQKSAD" || Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IQKSMG" || Convert.ToString(CommonUtility.GetCurrentUserRole()) == "SU")
        {

            if (StatusID == "5")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);
                mainMenu.Items.Remove(mainMenu.Items[3]);
                mvwCandidateBriefDetails.ActiveViewIndex = 1;
            }
            else if (StatusID == "6")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mainMenu.Items.Remove(mainMenu.Items[4]);
                mvwCandidateBriefDetails.ActiveViewIndex = 2;
            }
            else if (StatusID == "7")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mainMenu.Items.Remove(mainMenu.Items[5]);
                mvwCandidateBriefDetails.ActiveViewIndex = 3;
            }
            else if (StatusID == "8")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mvwCandidateBriefDetails.ActiveViewIndex = 4;
            }
            else if (StatusID == "9")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mainMenu.Items.Remove(mainMenu.Items[7]);
                mainMenu.Items.Remove(mainMenu.Items[6]);
                mvwCandidateBriefDetails.ActiveViewIndex = 5;

            }
            else if (StatusID == "10" || StatusID == "11" || StatusID == "27")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);

                mvwCandidateBriefDetails.ActiveViewIndex = 7;

            }
            else if (StatusID == "12" || StatusID == "13" || StatusID == "28")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);

                mvwCandidateBriefDetails.ActiveViewIndex = 8;

            }
            else if (StatusID == "14" || StatusID == "15" || StatusID == "29")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);

                mvwCandidateBriefDetails.ActiveViewIndex = 9;

            }
            else if (StatusID == "16" || StatusID == "17" || StatusID == "30")
            {

                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);

                mvwCandidateBriefDetails.ActiveViewIndex = 10;

            }
            else if (StatusID == "18" || StatusID == "19")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);

                mvwCandidateBriefDetails.ActiveViewIndex = 11;

            }
            else if (StatusID == "20" || StatusID == "21")
            {

                mvwCandidateBriefDetails.ActiveViewIndex = 12;

            }
            else if (StatusID == "24")
            {
                mainMenu.Items.Remove(mainMenu.Items[12]);
                mainMenu.Items.Remove(mainMenu.Items[11]);
                mainMenu.Items.Remove(mainMenu.Items[10]);
                mainMenu.Items.Remove(mainMenu.Items[9]);
                mainMenu.Items.Remove(mainMenu.Items[8]);
                mvwCandidateBriefDetails.ActiveViewIndex = 6;
            }

            tblModerator.Visible = false;
            tblModeratorGrid.Visible = true;
            tblResearchLead.Visible = false;
            tblResearchLeadGrid.Visible = true;
            tblAuditor.Visible = false;
            tblAuditorGrid.Visible = true;
            tblIE.Visible = false;
            tblIEGrid.Visible = true;
            tbRegional.Visible = false;
            tblRegionalGrid.Visible = true;
            tblGDGrid.Visible = true;
            tbGlobal.Visible = false;

        }

    }

    public void GetCandidateData(DataTable DtCandidateData)
    {
        tdAccreditationType.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["AccrediationType"]);
        string strCandidateType = Convert.ToString(DtCandidateData.Rows[0]["CandidateType"]);
        tdCandidateType.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["CandidateType"]);
        if (strCandidateType == "Independent")
        {
            trMarketReserachCompany.Visible = false;
        }
        else
        {
            trMarketReserachCompany.Visible = true;
            tdMarketReserachCompany.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["CompanyName"]);
        }
        hdnCandidateRole.Value = Convert.ToString(DtCandidateData.Rows[0]["CandidateRole"]);
        // tdCandidateType.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["CandidateType"]);
        // tdCompanyName.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["CompanyName"]);
        tdEmail.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["Email"]);
        tdRegistrationNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["RegistrationNo"]);

        tdFirstName.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["FirstName"]);
        string middlename = Convert.ToString(DtCandidateData.Rows[0]["MiddleName"]);
        if (middlename == "")
        {
            tdMiddleName.InnerHtml = "&nbsp;&nbsp;-";

        }
        else
        {
            tdMiddleName.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["MiddleName"]);

        }

        //tdMiddleName.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["MiddleName"]);
        tdLastName.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["LastName"]);
        tdDOB.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["DOB"]);
        tdGender.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["Gender"]);
        tdNationality.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["NationalityName"]);
        tdContectAddress.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["ContactAddress"]);
        tdCountry.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["CountryName"]);
        tdState.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["StateName"]);
        tdZipCode.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["ZipCode"]);

        string otherphoneno = Convert.ToString(DtCandidateData.Rows[0]["OtherPhoneNo"]);
        string[] otherphonenoparts = otherphoneno.Split('-');
        if (otherphonenoparts[0] == "" || otherphonenoparts[1] == "" || otherphonenoparts[2] == "")
        { tdHomePhoneNo.InnerHtml = "&nbsp;&nbsp;-"; }
        else
        {
            tdHomePhoneNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["OtherPhoneNo"]);

        }


        string phoneno = Convert.ToString(DtCandidateData.Rows[0]["PhoneNo"]);
        string[] phonenoparts = phoneno.Split('-');
        if (phonenoparts[0] == "" || phonenoparts[1] == "" || phonenoparts[2] == "")
        { tdWorkPhoneNo.InnerHtml = "&nbsp;&nbsp;-"; }
        else
        {
            tdWorkPhoneNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["PhoneNo"]);

        }


        // tdMobileNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["MobileNo"]);
        string mobileno = Convert.ToString(DtCandidateData.Rows[0]["MobileNo"]);
        string[] mobparts = mobileno.Split('-');
        if (mobparts[1] == "")
        { tdMobileNo.InnerHtml = "&nbsp;&nbsp;-"; }
        else
        {
            tdMobileNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["MobileNo"]);

        }


        // tdHomePhoneNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["OtherPhoneNo"]);
        //tdWorkPhoneNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["PhoneNo"]);
        // tdMobileNo.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["MobileNo"]);
        tdGraduation.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["GraduationType"]);
        tdSpecialization.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["Specialisation"]);
        tdUniversity.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["University"]);
        tdStatus.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["QualificationStatus"]);
        // tdCompanyName.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["CompanyName"]);

        string strProfilePath = Convert.ToString(DtCandidateData.Rows[0]["ProfilePicturePath"]);
        if (strProfilePath == "")
        {
            Image1.ImageUrl = "~/Images/Unknown2.jpg";
        }
        else
        {
            Image1.ImageUrl = DocumentPath + '/' + strProfilePath;
        }
        //Image1.ImageUrl = Convert.ToString(DtCandidateData.Rows[0]["ProfilePicturePath"]);

        tdCandidateLanguageDetail.InnerHtml = Convert.ToString(DtCandidateData.Rows[0]["LanguageList"]);

        string strPath = string.Empty;
        string strCvTitle = Convert.ToString(DtCandidateData.Rows[0]["CVPath"]);
        string strAuthority = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath;
        string strUCvpath = CVPath.Remove(0, 1);

        strPath = strAuthority + strUCvpath + strCvTitle;

        tdUploadResume.InnerHtml = "<a href=javascript:onClickLink('" + strPath + "')>" + "<b>Click Here</b>" + "</a>";


    }

    public string GetBriefDownload(object objDocumentFile)
    {
        string strPath = string.Empty;
        strPath = Convert.ToString(ConfigurationSettings.AppSettings["BriefDoc"]) + Convert.ToString(objDocumentFile);
        strPath = "javascript:onClickLink('" + strPath.Replace("~", "..") + "')";
        return strPath;
    }
    public string GetProposalBriefDocumentDownload(object objProposalDocumentFile)
    {
        string strPathProDoc = string.Empty;
        strPathProDoc = Convert.ToString(ConfigurationSettings.AppSettings["ProposalPath"]) + Convert.ToString(objProposalDocumentFile);
        strPathProDoc = "javascript:onClickLinkProposal('" + strPathProDoc.Replace("~", "..") + "')";
        return strPathProDoc;
    }

    public string GetReviewDocumentDownload(object objReviewDocumentFile)
    {
        string strPathReviewDoc = string.Empty;
        strPathReviewDoc = Convert.ToString(ConfigurationSettings.AppSettings["ReviewPath"]) + Convert.ToString(objReviewDocumentFile);
        strPathReviewDoc = "javascript:onClickLinkReview('" + strPathReviewDoc.Replace("~", "..") + "')";
        return strPathReviewDoc;
    }

    private void GetUsersCompany(DataTable DtUsersCompanyData)
    {
        gvUser.DataSource = (DtUsersCompanyData);
        gvUser.DataBind();
    }

    protected void gvCandidateSelectAssessordate_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {

        DataSet objDs = new DataSet();
        objDs = GetCandidateBriefReviewDetails();
        gvCandidateSelectAssessordate.PageIndex = e.NewPageIndex;
        gvCandidateSelectAssessordate.DataSource = objDs.Tables[9];
        gvCandidateSelectAssessordate.DataBind();
    }
    private void LoadBindData(object sender, EventArgs e)
    {

        ActivityMasterBAL objActMstBAL = new ActivityMasterBAL();
        DataSet objjActMstDs = new DataSet();

        //Added By Prashant
        objjActMstDs = objActMstBAL.GetActivityByActivityType("TYPEACCREDITATION");
        CommonUtility.BindDropDown(ref ddlAccreditationType, objjActMstDs, "ActivityName", "ActivityID");
        CommonUtility.AddSelectToDropDownAsEmptyValue(ref ddlAccreditationType);
        //

        DataSet objDs = new DataSet();
        objDs = GetCandidateBriefReviewDetails();

        if (objDs.Tables.Count > 0)
        {
            GetCandidateData(objDs.Tables[0]);

            GetUsersCompany(objDs.Tables[1]);

            //brief detail table
            if (objDs.Tables[2].Rows.Count > 0)
            {
                tdBriefName.InnerHtml = Convert.ToString(objDs.Tables[2].Rows[0]["BriefTitle"]);
                tdBriefDesc.InnerHtml = Convert.ToString(objDs.Tables[2].Rows[0]["BriefDesc"]);
                tdBriefStartDt.InnerHtml = Convert.ToString(objDs.Tables[2].Rows[0]["BriefStartDate"]);
                tdBriefEndDt.InnerHtml = Convert.ToString(objDs.Tables[2].Rows[0]["BriefEndDate"]);
                hdnCandidateStatus.Value = Convert.ToString(objDs.Tables[2].Rows[0]["CandidateStatusID"]);
                hdnCandidateBriefId.Value = Convert.ToString(objDs.Tables[2].Rows[0]["CandidateBriefID"]);
                hdnCandidateID.Value = Convert.ToString(objDs.Tables[2].Rows[0]["CandidateID"]);
            }
            else
            {
                hdnCandidateStatus.Value = "0";
            }

            //brief docuemnt details 
            if (objDs.Tables[3].Rows.Count > 0)
            {
                grdBriefDocument.DataSource = objDs.Tables[3];
                grdBriefDocument.DataBind();
            }


            //candidate query against breif 
            if (objDs.Tables[4].Rows.Count > 0)
            {
                DataView objDv = new DataView();
                objDv = objDs.Tables[4].DefaultView;
                objDv.RowFilter = "QueryTypeID  = 1";
                if (objDv.Count > 0)
                {

                    trQuestion.Visible = true;
                    trQuestionSpace1.Visible = true;
                    trAssessorComments.Visible = true;
                    trQuestionSpace2.Visible = true;
                    txtQuestionAssessor.Enabled = false;

                    hdnCandidateQueryID.Value = Convert.ToString(objDv[0]["CandidateQueryID"]);
                    txtQuestionAssessor.Text = Convert.ToString(objDv[0]["Query"]);
                    lblBriefDetailsQueforAss.Text = Convert.ToString(objDv[0]["QueryDate"]);
                    txtAssessorComments.Text = Convert.ToString(objDv[0]["Answer"]);
                    lblBriefDetailsAssComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);

                    trQuestion.Visible = true;
                    trQuestionSpace1.Visible = true;
                    trAssessorComments.Visible = true;
                    trQuestionAdd.Visible = true;

                    if (txtAssessorComments.Text.Trim().Length > 0)
                    {
                        txtAssessorComments.Enabled = false;
                        btnAddQuestion.Enabled = false;
                        btnAddQuestion.Visible = false;
                        btnCancelQuestion.Enabled = false;
                        btnCancelQuestion.Visible = false;
                    }
                    else
                    {
                        if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RD")
                        {
                            txtAssessorComments.Enabled = true;
                            btnAddQuestion.Enabled = true;
                            btnAddQuestion.Visible = true;
                            btnCancelQuestion.Enabled = true;
                            btnCancelQuestion.Visible = true;
                        }
                        else
                        {
                            txtAssessorComments.Enabled = false;
                            btnAddQuestion.Enabled = false;
                            btnAddQuestion.Visible = false;
                            btnCancelQuestion.Enabled = false;
                            btnCancelQuestion.Visible = false;
                        }

                    }
                }
                else
                {

                    trQuestion.Visible = false;
                    trQuestionSpace1.Visible = false;
                    trAssessorComments.Visible = false;
                    trQuestionSpace2.Visible = false;
                    txtAssessorComments.Enabled = false;
                    txtQuestionAssessor.Enabled = false;
                    trQuestion.Visible = false;
                    trQuestionSpace1.Visible = false;
                    trAssessorComments.Visible = false;
                    trQuestionAdd.Visible = false;
                    btnAddQuestion.Enabled = false;
                    btnAddQuestion.Visible = false;
                    btnCancelQuestion.Enabled = false;
                    btnCancelQuestion.Visible = false;

                }

                objDv.RowFilter = "QueryTypeID  = 2";
                if (objDv.Count > 0)
                {
                    btnAddComment.Enabled = false;
                    btnAddComment.Visible = false;
                    btnCancelComment.Enabled = false;
                    btnCancelComment.Visible = false;
                    rbMQuestionYes.Checked = true;
                    rbMQuestionNo.Checked = false;
                    rbMQuestionYes.Enabled = false;
                    rbMQuestionNo.Enabled = false;
                    txtQuestionForMCan.Enabled = false;
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RAM")
                    {
                        rbQuestionYes_CheckedChanged(sender, e);
                        trMQuestion1.Visible = false;
                        trMQuestion2.Visible = false;

                        txtQuestionForMCan.Text = Convert.ToString(objDv[0]["Query"]);
                        lblModAssReviewQueforCandidate.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        txtCandidateMComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblModAssReviewCandidateComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                    }
                }
                else
                {
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RAM")
                    {
                        rbQuestionNo_CheckedChanged(sender, null);
                    }
                }


                objDv.RowFilter = "QueryTypeID  = 3";
                if (objDv.Count > 0)
                {
                    btnRLAddQuestion.Enabled = false;
                    btnRLAddQuestion.Visible = false;
                    btnRLAddCancel.Enabled = false;
                    btnRLAddCancel.Visible = false;
                    rbRLYes.Checked = true;
                    rbRLNo.Checked = false;
                    rbRLNo.Enabled = false;
                    rbRLYes.Enabled = false;
                    txtQuestionM.Enabled = false;
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RARL")
                    {
                        rbRLYes_CheckedChanged(sender, e);
                        trRLAddQuesionSpace2.Visible = false;
                        trRLAddQuesionSpace1.Visible = false;

                        txtQuestionM.Text = Convert.ToString(objDv[0]["Query"]);
                        lblRLAssReviewQueForModAss.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        txtQuestionMC.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblRLAssReviewModAssComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);

                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RAM")
                    {
                        hdnMoreQueryID.Value = Convert.ToString(objDv[0]["CandidateQueryID"]);
                        tdMoreQuestion.InnerHtml = "Question from Research Lead?";
                        mainMenu.Items[mainMenu.Items.Count - 1].Text = "Research Lead Question";
                        lblMoreDetails.Text = "Research Lead Question";
                        txtQuestionFromAssessor.Text = Convert.ToString(objDv[0]["Query"]);
                        lblMoreDetailsQueforAss.Text = Convert.ToString(objDv[0]["QueryDate"]);

                        hdnMoreQueryTypeID.Value = Convert.ToString(objDv[0]["QueryTypeID"]);
                        txtModeratorComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblMoreDetailsYourComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);

                        if (txtModeratorComment.Text.Trim().Length > 0)
                        {
                            txtModeratorComment.Enabled = false;
                            btnMoreAdd.Enabled = false;
                            btnMoreAdd.Visible = false;
                            btnMoreCancel.Enabled = false;
                            btnMoreCancel.Visible = false;
                        }
                    }

                }
                else
                {
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RARL")
                    {
                        rbRLNo_CheckedChanged(sender, null);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RAM")
                    {
                        //MORE Comment remove
                        mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                    }
                }


                objDv.RowFilter = "QueryTypeID  = 4";
                if (objDv.Count > 0)
                {
                    btnAddAuditorQuest.Enabled = false;
                    btnAddAuditorQuest.Visible = false;
                    btnCancelAuditorQuest.Enabled = false;
                    btnCancelAuditorQuest.Visible = false;
                    rbRLQuesYes.Checked = true;
                    rbRLQuesNo.Checked = false;
                    rbRLQuesNo.Enabled = false;
                    rbRLQuesYes.Enabled = false;
                    txtQuestionRL.Enabled = false;

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "AD")
                    {
                        rbRLQuesYes_CheckedChanged(sender, e);
                        trAuditorQuesion1.Visible = false;
                        trAuditorQuesion2.Visible = false;
                        //trAuditor5.Visible = false;


                        txtQuestionRL.Text = Convert.ToString(objDv[0]["Query"]);
                        lblAuditorReviewQueforRL.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        txtRLComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblAuditorReviewRLComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RARL")
                    {
                        hdnMoreQueryID.Value = Convert.ToString(objDv[0]["CandidateQueryID"]);
                        tdMoreQuestion.InnerHtml = "Question from Auditor?";
                        mainMenu.Items[mainMenu.Items.Count - 1].Text = "Auditor Question";
                        lblMoreDetails.Text = "Auditor Question";
                        txtQuestionFromAssessor.Text = Convert.ToString(objDv[0]["Query"]);
                        lblMoreDetailsQueforAss.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        hdnMoreQueryTypeID.Value = Convert.ToString(objDv[0]["QueryTypeID"]);
                        txtModeratorComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblMoreDetailsYourComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                        if (txtModeratorComment.Text.Trim().Length > 0)
                        {
                            txtModeratorComment.Enabled = false;
                            btnMoreAdd.Enabled = false;
                            btnMoreAdd.Visible = false;
                            btnMoreCancel.Enabled = false;
                            btnMoreCancel.Visible = false;
                        }
                    }
                }
                else
                {
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "AD")
                    {
                        rbRLQuesNo_CheckedChanged(sender, null);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RARL")
                    {
                        //MORE Comment remove
                        mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                    }
                }

                objDv.RowFilter = "QueryTypeID  = 5";
                if (objDv.Count > 0)
                {
                    btnIEQuestion.Enabled = false;
                    btnIEQuestion.Visible = false;
                    btnIEQuestionCancel.Enabled = false;
                    btnIEQuestionCancel.Visible = false;
                    rbIEQuestionYes.Checked = true;
                    rbIEQuestionNo.Checked = false;
                    rbIEQuestionNo.Enabled = false;
                    rbIEQuestionYes.Enabled = false;
                    txtQusForAuti.Enabled = false;
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IE")
                    {
                        rbIEQuestionYes_CheckedChanged(sender, e);
                        trIEQuestion1.Visible = false;
                        trIEQuestion2.Visible = false;


                        txtQusForAuti.Text = Convert.ToString(objDv[0]["Query"]);
                        lblIndExpQueforAuditor.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        txtAudComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblIndExpAuditorComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "AD")
                    {
                        hdnMoreQueryID.Value = Convert.ToString(objDv[0]["CandidateQueryID"]);
                        tdMoreQuestion.InnerHtml = "Question from Industry Expert?";
                        mainMenu.Items[mainMenu.Items.Count - 1].Text = "Industry Expert Question";
                        lblMoreDetails.Text = "Industry Expert Question";
                        txtQuestionFromAssessor.Text = Convert.ToString(objDv[0]["Query"]);
                        lblMoreDetailsQueforAss.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        hdnMoreQueryTypeID.Value = Convert.ToString(objDv[0]["QueryTypeID"]);
                        txtModeratorComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblMoreDetailsYourComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                        if (txtModeratorComment.Text.Trim().Length > 0)
                        {
                            txtModeratorComment.Enabled = false;
                            btnMoreAdd.Enabled = false;
                            btnMoreAdd.Visible = false;
                            btnMoreCancel.Enabled = false;
                            btnMoreCancel.Visible = false;
                        }
                    }
                }
                else
                {
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IE")
                    {
                        rbIEQuestionNo_CheckedChanged(sender, null);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "AD")
                    {
                        //MORE Comment remove
                        mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                        btnMoreAdd.Enabled = false;
                        btnMoreAdd.Visible = false;
                        btnMoreCancel.Enabled = false;
                        btnMoreCancel.Visible = false;
                    }
                }


                objDv.RowFilter = "QueryTypeID  = 6";
                if (objDv.Count > 0)
                {
                    btnRDADDQuestion.Enabled = false;
                    btnRDADDQuestion.Visible = false;
                    btnRDCancelQuestion.Enabled = false;
                    btnRDCancelQuestion.Visible = false;
                    rbRdYes.Checked = true;
                    rbRdNo.Checked = false;
                    rbRdNo.Enabled = false;
                    rbRdYes.Enabled = false;
                    txtIEQus.Enabled = false;
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RD")
                    {
                        rbRdYes_CheckedChanged(sender, e);
                        trRDQuestion1.Visible = false;
                        trRDQuestion2.Visible = false;

                        txtIEQus.Text = Convert.ToString(objDv[0]["Query"]);
                        lblRegDirQueforIndExp.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        txtIEComm.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblRegDirIndExpComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);

                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IE")
                    {
                        hdnMoreQueryID.Value = Convert.ToString(objDv[0]["CandidateQueryID"]);
                        tdMoreQuestion.InnerHtml = "Question from Reigonal Director?";
                        mainMenu.Items[mainMenu.Items.Count - 1].Text = "Regional Director Question";
                        lblMoreDetails.Text = "Regional Director Question";
                        txtQuestionFromAssessor.Text = Convert.ToString(objDv[0]["Query"]);
                        lblMoreDetailsQueforAss.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        hdnMoreQueryTypeID.Value = Convert.ToString(objDv[0]["QueryTypeID"]);
                        txtModeratorComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblMoreDetailsYourComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                        if (txtModeratorComment.Text.Trim().Length > 0)
                        {
                            txtModeratorComment.Enabled = false;
                            btnMoreAdd.Enabled = false;
                            btnMoreAdd.Visible = false;
                            btnMoreCancel.Enabled = false;
                            btnMoreCancel.Visible = false;
                        }
                    }

                }
                else
                {
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RD")
                    {
                        rbRdNo_CheckedChanged(sender, null);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IE")
                    {
                        //MORE Comment remove
                        mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                    }
                }


                objDv.RowFilter = "QueryTypeID  = 7";
                if (objDv.Count > 0)
                {
                    btnAddGDAddQuestion.Enabled = false;
                    btnAddGDAddQuestion.Visible = false;
                    btnCancelGDAddQuestion.Enabled = false;
                    btnCancelGDAddQuestion.Visible = false;
                    rdGdYes.Checked = true;
                    rdGdNo.Checked = false;
                    rdGdNo.Enabled = false;
                    rdGdYes.Enabled = false;
                    txtGDQuestion.Enabled = false;
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "GD")
                    {
                        rdGdYes_CheckedChanged(sender, e);
                        trGDAddQuestion1.Visible = false;
                        trGDAddQuestion2.Visible = false;

                        txtGDQuestion.Text = Convert.ToString(objDv[0]["Query"]);
                        lblGlobalDirQueforRegDir.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        txtRdComments.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblGlobalDirRegDirComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RD")
                    {

                        hdnMoreQueryID.Value = Convert.ToString(objDv[0]["CandidateQueryID"]);
                        tdMoreQuestion.InnerHtml = "Question from Global Director?";
                        mainMenu.Items[13].Text = "Global Director Question";
                        lblMoreDetails.Text = "Global Director Question";
                        txtQuestionFromAssessor.Text = Convert.ToString(objDv[0]["Query"]);
                        lblMoreDetailsQueforAss.Text = Convert.ToString(objDv[0]["QueryDate"]);
                        hdnMoreQueryTypeID.Value = Convert.ToString(objDv[0]["QueryTypeID"]);
                        txtModeratorComment.Text = Convert.ToString(objDv[0]["Answer"]);
                        lblMoreDetailsYourComment.Text = Convert.ToString(objDv[0]["AnswerDate"]);
                        if (txtModeratorComment.Text.Trim().Length > 0)
                        {
                            txtModeratorComment.Enabled = false;
                            btnMoreAdd.Enabled = false;
                            btnMoreAdd.Visible = false;
                            btnMoreCancel.Enabled = false;
                            btnMoreCancel.Visible = false;
                        }

                    }
                }
                else
                {
                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "GD")
                    {
                        //MORE Comment remove
                        mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                        rdGdNo_CheckedChanged(sender, null);
                    }

                    if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "RD")
                    {
                        //MORE Comment remove
                        mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                    }
                }

                if (Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IQKSAD" || Convert.ToString(CommonUtility.GetCurrentUserRole()) == "IQKSMG" || Convert.ToString(CommonUtility.GetCurrentUserRole()) == "SU")
                {
                    //MORE Comment remove
                    mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                }

            }
            else
            {
                trQuestion.Visible = false;
                trQuestionSpace1.Visible = false;
                trQuestionSpace2.Visible = false;
                trAssessorComments.Visible = false;
                trQuestionAdd.Visible = false;
                //if (Convert.ToString(CommonUtility.GetCurrentUserRole()) != "GD")
                //{
                mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);
                //}
            }

            if (objDs.Tables[5].Rows.Count > 0)
            {
                DataView objDv = new DataView();
                objDv = objDs.Tables[5].DefaultView;
                objDv.RowFilter = "DocumentTypeID  = 1";
                if (objDv.Count > 0)
                {
                    gvProposalDocument.DataSource = objDv;
                    gvProposalDocument.DataBind();
                }
                objDv.RowFilter = "DocumentTypeID  = 2";
                if (objDv.Count > 0)
                {
                    gvGDDocument.DataSource = objDv;
                    gvGDDocument.DataBind();
                }

                objDv.RowFilter = "DocumentTypeID  = 3";
                if (objDv.Count > 0)
                {
                    gvContentAnalysis.DataSource = objDv;
                    gvContentAnalysis.DataBind();
                }

                objDv.RowFilter = "DocumentTypeID  = 4";
                if (objDv.Count > 0)
                {
                    gvPastResarch.DataSource = objDv;
                    gvPastResarch.DataBind();
                }

                objDv.RowFilter = "DocumentTypeID  = 5";
                if (objDv.Count > 0)
                {
                    gvMarketResearch.DataSource = objDv;
                    gvMarketResearch.DataBind();
                }
                objDv.RowFilter = "DocumentTypeID  = 10";
                if (objDv.Count > 0)
                {
                    gvStDocument.DataSource = objDv;
                    gvStDocument.DataBind();
                }
            }


            if (objDs.Tables[6].Rows.Count > 0)
            {
                DataView objDv = new DataView();
                objDv = objDs.Tables[6].DefaultView;

                DataView objDvType = new DataView();
                objDvType = objDs.Tables[0].DefaultView;

                objDv.RowFilter = "StatusID  = 27 OR StatusID  = 10 OR StatusID  = 11";
                if (objDv.Count > 0)
                {
                    if (Convert.ToString(objDv[0]["StatusID"]) == "10" || Convert.ToString(objDv[0]["StatusID"]) == "11")
                    {
                        gvMDocument.Columns[2].Visible = false;
                        gvMReviewFile.DataSource = objDv;
                        gvMReviewFile.DataBind();
                        btnAddMReview.Enabled = false;
                        gvMReviewFile.Visible = false;
                        btnAddMReview.Visible = false;
                        btnMUpload.Enabled = false;
                        btnMUpload.Visible = false;
                        //btnCancelMReview.Enabled = false;
                        fuMReviewDocument.Enabled = false;
                        txtMReviewComment.Enabled = false;
                        ddlMReviewStatus.Enabled = false;

                        trReview1.Visible = false;
                        trReview2.Visible = false;
                        trMReview3.Visible = false;
                        trMReview4.Visible = false;
                        trMReview5.Visible = false;

                        txtMReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlMReviewStatus.SelectedIndex = ddlMReviewStatus.Items.IndexOf(ddlMReviewStatus.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    }
                    else if (Convert.ToString(objDv[0]["StatusID"]) == "27")
                    {
                        gvMReviewFile.DataSource = objDv;
                        gvMReviewFile.DataBind();
                        gvMReviewFile.Visible = false;
                        btnAddMReview.Enabled = true;
                        btnAddMReview.Visible = true;


                        btnMUpload.Enabled = true;
                        btnMUpload.Visible = true;
                        //btnCancelMReview.Enabled = false;
                        fuMReviewDocument.Enabled = true;
                        txtMReviewComment.Enabled = true;
                        ddlMReviewStatus.Enabled = true;
                        txtMReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlMReviewStatus.SelectedIndex = ddlMReviewStatus.Items.IndexOf(ddlMReviewStatus.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    }
                }
                else
                {
                    btnAddMReview.Enabled = true;
                    btnAddMReview.Visible = true;
                    //btnCancelMReview.Enabled = true;
                    fuMReviewDocument.Enabled = true;
                    txtMReviewComment.Enabled = true;
                    ddlMReviewStatus.Enabled = true;
                    btnMUpload.Enabled = true;
                    btnMUpload.Visible = true;
                }


                objDv.RowFilter = "StatusID  = 28 OR StatusID  = 12 OR StatusID  = 13";
                if (objDv.Count > 0)
                {
                    if (Convert.ToString(objDv[0]["StatusID"]) == "12" || Convert.ToString(objDv[0]["StatusID"]) == "13")
                    {
                        gvRLReviewFile.DataSource = objDv;
                        gvRLReviewFile.DataBind();
                        gvMReviewFile.Visible = false;
                        btnRLADD.Enabled = false;
                        btnRLADD.Visible = false;
                        //btnRLCancel.Enabled = false;
                        fuReviewDocument.Enabled = false;
                        txtRLReviewComment.Enabled = false;
                        ddlRLReviewStatus.Enabled = false;

                        trRLReview4.Visible = false;
                        trRLReview14.Visible = false;
                        trRLReview15.Visible = false;
                        trRLReview16.Visible = false;
                        trRLReview17.Visible = false;


                        txtRLReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlRLReviewStatus.SelectedIndex = ddlRLReviewStatus.Items.IndexOf(ddlRLReviewStatus.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    }
                    else if (Convert.ToString(objDv[0]["StatusID"]) == "28")
                    {
                        gvRLReviewFile.DataSource = objDv;
                        gvRLReviewFile.DataBind();
                        gvRLReviewFile.Visible = false;

                        btnRLADD.Enabled = true;
                        btnRLADD.Visible = true;
                        //btnRLCancel.Enabled = false;
                        fuReviewDocument.Enabled = true;
                        txtRLReviewComment.Enabled = true;
                        ddlRLReviewStatus.Enabled = true;
                        txtRLReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlRLReviewStatus.SelectedIndex = ddlRLReviewStatus.Items.IndexOf(ddlRLReviewStatus.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    }
                }
                else
                {
                    btnRLADD.Enabled = true;
                    btnRLADD.Visible = true;
                    //btnRLCancel.Enabled = true;
                    fuReviewDocument.Enabled = true;
                    txtRLReviewComment.Enabled = true;
                    ddlRLReviewStatus.Enabled = true;
                }


                objDv.RowFilter = "StatusID  = 29 OR StatusID  = 14 OR StatusID  = 15";
                if (objDv.Count > 0)
                {
                    if (Convert.ToString(objDv[0]["StatusID"]) == "14" || Convert.ToString(objDv[0]["StatusID"]) == "15")
                    {
                        gvADReviewFile.DataSource = objDv;
                        gvADReviewFile.DataBind();
                        btnAuditorReview.Enabled = false;
                        btnAuditorReview.Visible = false;

                        trAuditor5.Visible = false;
                        trAuditor50.Visible = false;
                        trAuditor51.Visible = false;
                        trAuditor52.Visible = false;
                        trAuditor53.Visible = false;

                        //btnAuditorReviewCancel.Enabled = false;
                        fuAuditorReview.Enabled = false;
                        txtAuditorReviewComment.Enabled = false;
                        ddlAuditorReview.Enabled = false;
                        //Added by Prashant
                        ddlAccreditationType.Enabled = false;
                        txtAuditorReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlAuditorReview.SelectedIndex = ddlAuditorReview.Items.IndexOf(ddlAuditorReview.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                        //Added by Prashant
                        ddlAccreditationType.SelectedIndex = ddlAccreditationType.Items.IndexOf(ddlAccreditationType.Items.FindByValue(Convert.ToString(objDvType[0]["TypeBriefAccrediationID"])));
                    }
                    else if (Convert.ToString(objDv[0]["StatusID"]) == "29")
                    {
                        gvADReviewFile.DataSource = objDv;
                        gvADReviewFile.DataBind();



                        gvRLReviewFile.Visible = false;
                        btnAuditorReview.Enabled = true;
                        btnAuditorReview.Visible = true;
                        //btnAuditorReviewCancel.Enabled = false;
                        fuAuditorReview.Enabled = true;
                        txtAuditorReviewComment.Enabled = true;
                        ddlAuditorReview.Enabled = true;
                        //Added by Prashant
                        ddlAccreditationType.Enabled = true;
                        txtAuditorReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlAuditorReview.SelectedIndex = ddlAuditorReview.Items.IndexOf(ddlAuditorReview.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                        //Added by Prashant
                        ddlAccreditationType.SelectedIndex = ddlAccreditationType.Items.IndexOf(ddlAccreditationType.Items.FindByValue(Convert.ToString(objDvType[0]["TypeBriefAccrediationID"])));
                    }
                }
                else
                {
                    btnAuditorReview.Enabled = true;
                    btnAuditorReview.Visible = true;
                    //btnAuditorReviewCancel.Enabled = true;
                    fuAuditorReview.Enabled = true;
                    txtAuditorReviewComment.Enabled = true;
                    ddlAuditorReview.Enabled = true;
                    //Added by Prashant
                    ddlAccreditationType.Enabled = true;
                }

                objDv.RowFilter = "StatusID  = 30 OR StatusID  = 16 OR StatusID  = 17";
                if (objDv.Count > 0)
                {
                    if (Convert.ToString(objDv[0]["StatusID"]) == "16" || Convert.ToString(objDv[0]["StatusID"]) == "17")
                    {
                        gvIEReview.DataSource = objDv;
                        gvIEReview.DataBind();
                        gvIEReview.Visible = false;

                        btnIEAddReview.Enabled = false;
                        btnIEAddReview.Visible = false;
                        //btnIECancelReview.Enabled = false;
                        fuIEReview.Enabled = false;

                        trIE50.Visible = false;
                        trIE51.Visible = false;
                        trIE52.Visible = false;
                        trIE53.Visible = false;

                        txtIEReviewComment.Enabled = false;
                        ddlIEReviewComment.Enabled = false;
                        txtIEReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlIEReviewComment.SelectedIndex = ddlIEReviewComment.Items.IndexOf(ddlIEReviewComment.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    }
                    else if (Convert.ToString(objDv[0]["StatusID"]) == "30")
                    {
                        gvIEReview.DataSource = objDv;
                        gvIEReview.DataBind();
                        gvIEReview.Visible = false;

                        btnIEAddReview.Enabled = true;
                        btnIEAddReview.Visible = true;
                        //btnIECancelReview.Enabled = false;
                        fuIEReview.Enabled = true;
                        txtIEReviewComment.Enabled = true;
                        ddlIEReviewComment.Enabled = true;
                        txtIEReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                        ddlIEReviewComment.SelectedIndex = ddlIEReviewComment.Items.IndexOf(ddlIEReviewComment.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    }
                }

                else
                {
                    btnIEAddReview.Enabled = true;
                    btnIEAddReview.Visible = true;
                    //btnIECancelReview.Enabled = true;
                    fuIEReview.Enabled = true;
                    txtIEReviewComment.Enabled = true;
                    ddlIEReviewComment.Enabled = true;
                }


                objDv.RowFilter = "AssessorID  = -1 AND RoleName='RD'";
                if (objDv.Count > 0)
                {
                    btnAddRegD.Enabled = false;
                    btnAddRegD.Visible = false;
                    //btnCancelRegD.Enabled = false;
                    txtRDRevComm.Enabled = false;
                    ddlRDStatus.Enabled = false;
                    txtRDRevComm.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                    ddlRDStatus.SelectedIndex = ddlRDStatus.Items.IndexOf(ddlRDStatus.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                    gvRegionalDoc.DataSource = objDv;
                    gvRegionalDoc.DataBind();

                }
                else
                {
                    btnAddRegD.Enabled = true;
                    btnAddRegD.Visible = true;
                    //btnCancelRegD.Enabled = true;
                    txtRDRevComm.Enabled = true;
                    ddlRDStatus.Enabled = true;
                }


                //objDv.RowFilter = "DocumentTypeID  = -1 AND RoleName='GD'";
                //if (objDv.Count > 0)
                //{
                //    btnGlobalAdd.Enabled = false;
                //    btnGlobalAdd.Visible = false;
                //    //btnGlobalCancel.Enabled = false;
                //    txtGDReviewComment.Enabled = false;
                //    ddlRevStatus.Enabled = false;
                //    txtGDReviewComment.Text = Convert.ToString(objDv[0]["AssessorRemark"]);
                //    ddlRevStatus.SelectedIndex = ddlRevStatus.Items.IndexOf(ddlRevStatus.Items.FindByValue(Convert.ToString(objDv[0]["StatusID"])));
                //    gdGrid.DataSource = objDv;
                //    gdGrid.DataBind();

                //}
                //else
                //{
                //    btnGlobalAdd.Enabled = true;
                //    btnGlobalAdd.Visible = true;
                //    //btnGlobalCancel.Enabled = true;
                //    txtGDReviewComment.Enabled = true;
                //    ddlRevStatus.Enabled = true;
                //}
            }

            if (objDs.Tables[7].Rows.Count > 0)
            {

                if (objDs.Tables[7].Rows.Count > 0)
                {
                    GetCandidateFeeDetails(objDs.Tables[7], objDs.Tables[0]);
                    string strUserRole = CommonUtility.GetCurrentUserRole();
                    if (strUserRole == "IQKSMG" || strUserRole == "IQKSAD" || strUserRole == "SU")
                    {
                        trAssesorAllocate.Visible = true;
                    }
                    else
                    {
                        trIqksMgr.Visible = false;
                        trTotalOExpense.Visible = false;
                        trPotalAdminExpenseComment.Visible = false;
                        trPortakAdminExpenseFee.Visible = false;
                        trTotalFee.Visible = false;
                        trDateAllocate.Visible = false;
                        trCurrencyType.Visible = false;

                        trCurrencyRate.Visible = false;
                        trGrandTotal.Visible = false;
                        trModAssFee.Visible = false;
                        trRLAssFee.Visible = false;
                        trAuditorFee.Visible = false;
                        trIExpertFee.Visible = false;

                    }

                }
                
                
                //AssessorMaster Details
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();

                DataView objDv = new DataView();
                objDv = objDs.Tables[7].DefaultView;
                objDv.RowFilter = "RoleName  = 'RAM'";

                if (objDv.Count > 0)
                {


                    if (Convert.ToString(hdnCandidateRole.Value) == "CANM")
                    {
                        hdnModUserID.Value = Convert.ToString(objDv[0]["AssessorUserId"]);
                        gvModeratorGrid.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(new Guid(hdnModUserID.Value), Convert.ToInt32(hdnCandidateBriefId.Value), 6);
                        gvModeratorGrid.DataBind();

                    }
                    else if (Convert.ToString(hdnCandidateRole.Value) == "CANR")
                    {

                    }
                    else if (Convert.ToString(hdnCandidateRole.Value) == "CANB")
                    {
                        hdnModUserID.Value = Convert.ToString(objDv[0]["AssessorUserId"]);
                        gvModeratorGrid.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(new Guid(hdnModUserID.Value), Convert.ToInt32(hdnCandidateBriefId.Value), 6);
                        gvModeratorGrid.DataBind();

                    }
                }


                objDv.RowFilter = "RoleName  = 'RARL'";
                if (objDv.Count > 0)
                {

                    if (Convert.ToString(hdnCandidateRole.Value) == "CANM")
                    {
                    }
                    else if (Convert.ToString(hdnCandidateRole.Value) == "CANR")
                    {
                        hdnRLUserID.Value = Convert.ToString(objDv[0]["AssessorUserId"]);
                        gvResearchLead.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(new Guid(hdnRLUserID.Value), Convert.ToInt32(hdnCandidateBriefId.Value), 7);
                        gvResearchLead.DataBind();
                    }
                    else if (Convert.ToString(hdnCandidateRole.Value) == "CANB")
                    {
                        hdnRLUserID.Value = Convert.ToString(objDv[0]["AssessorUserId"]);
                        gvResearchLead.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(new Guid(hdnRLUserID.Value), Convert.ToInt32(hdnCandidateBriefId.Value), 7);
                        gvResearchLead.DataBind();

                    }
                }

                objDv.RowFilter = "RoleName  = 'AD'";
                if (objDv.Count > 0)
                {
                    hdnAuditUserID.Value = Convert.ToString(objDv[0]["AssessorUserId"]);
                    gvAuditorGrid.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(new Guid(hdnAuditUserID.Value), Convert.ToInt32(hdnCandidateBriefId.Value), 8);
                    gvAuditorGrid.DataBind();
                }

                objDv.RowFilter = "RoleName  = 'IE'";
                if (objDv.Count > 0)
                {
                    hdnIEUserID.Value = Convert.ToString(objDv[0]["AssessorUserId"]);
                    gvIE.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(new Guid(hdnIEUserID.Value), Convert.ToInt32(hdnCandidateBriefId.Value), 9);
                    gvIE.DataBind();
                }

            }

            if (objDs.Tables[8].Rows.Count > 0)
            {
                DataView objDv = new DataView();
                objDv = objDs.Tables[8].DefaultView;

                lblGroupDiscussionType.InnerHtml = objDv[0]["GDTypeName"].ToString();
                lblLocation.InnerHtml = objDv[0]["GDLocation"].ToString();
                lblLanguage.InnerHtml = objDv[0]["GDLanguageList"].ToString();

                //int ModeratorType = Convert.ToString(objDv[0]["GDModeratorType"]) != "" ? Convert.ToInt32(objDv[0]["GDModeratorType"]) : 0;
                //if (ModeratorType == 1)
                //{
                //    lblModeratorType.Text = "Internal Moderator";
                //    trAssessorName.Visible = false;
                //    trCandidateName.Visible = true;
                //    lblCandidateName.Text = Convert.ToString(objDv[0]["UserName"]) + " [" + Convert.ToString(objDv[0]["RegistrationNO"]) + "]";
                //}
                //else if (ModeratorType == 2)
                //{
                //    lblModeratorType.Text = "External Moderator";
                //    trAssessorName.Visible = true;
                //    lblAssessorName.Text = Convert.ToString(objDv[0]["ExternalAssessorName"]);
                //    trCandidateName.Visible = false;
                //}
                //else
                //{
                //    lblModeratorType.Text = "Not Applicable";
                //    trAssessorName.Visible = false;
                //    trCandidateName.Visible = false;
                //}

                string sGDCandidateTime = objDv[0]["GDCandidateTime"].ToString();
                if (sGDCandidateTime != "" && sGDCandidateTime != String.Empty)
                {
                    TimeSpan tGDCandidateTime = TimeSpan.Parse(sGDCandidateTime);
                    if (tGDCandidateTime.Hours >= 12)
                    {
                        lblCandidateTime.InnerHtml = CommonUtility.GetHour(tGDCandidateTime.Hours).ToString("00") + " Hr. " + tGDCandidateTime.Minutes.ToString("00") + " Min. PM";
                    }
                    else
                    {
                        lblCandidateTime.InnerHtml = tGDCandidateTime.Hours.ToString("00") + " Hr. " + tGDCandidateTime.Minutes.ToString("00") + " Min. AM";
                    }
                }
                else
                {
                    lblCandidateTime.InnerHtml = sGDCandidateTime;
                }
            }
            //else
            //{
            //    lblModeratorType.Text = "Not Applicable";
            //    trAssessorName.Visible = false;
            //    trCandidateName.Visible = false;
            //}

            if (objDs.Tables[9].Rows.Count > 0)
            {
                gvCandidateSelectAssessordate.DataSource = objDs.Tables[9];
                gvCandidateSelectAssessordate.DataBind();
            }
            else
            {
                gvCandidateSelectAssessordate.DataSource = null;
                gvCandidateSelectAssessordate.DataBind();
            }


            if (objDs.Tables[10].Rows.Count > 0)
            {
                DataView objDv = new DataView();
                objDv = objDs.Tables[10].DefaultView;

                objDv.RowFilter = "DocumentTypeID  = 6";
                if (objDv.Count > 0)
                {
                    gvMDocument.DataSource = objDv;
                    gvMDocument.DataBind();
                }


                objDv.RowFilter = "DocumentTypeID  = 7";
                if (objDv.Count > 0)
                {
                    gvRLDocument.DataSource = objDv;
                    gvRLDocument.DataBind();
                }


                objDv.RowFilter = "DocumentTypeID  = 8";
                if (objDv.Count > 0)
                {
                    gvADDocument.DataSource = objDv;
                    gvADDocument.DataBind();
                }

                objDv.RowFilter = "DocumentTypeID  = 9";
                if (objDv.Count > 0)
                {
                    gvIEReviewFile.DataSource = objDv;
                    gvIEReviewFile.DataBind();
                }
            }

        }
        else
        {
            hdnCandidateStatus.Value = "0";
            //MORE Comment remove
            mainMenu.Items.Remove(mainMenu.Items[mainMenu.Items.Count - 1]);

        }
    }

    private void GetCandidateFeeDetails(DataTable userDataTable, DataTable usertable1)
    {
        if (userDataTable.Rows.Count > 0)
        {
            trAssesorAllocate.Visible = true;
            foreach (DataRow dr in userDataTable.Rows)
            {
                string userrole = Convert.ToString(dr["RoleName"]);
                switch (userrole)
                {
                    case "RAM": tdModAssessor.InnerHtml = Convert.ToString(dr["AssessorName"]);
                        tdModAssessorFee.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                        trModAss.Visible = true;
                        trModAssFee.Visible = true;
                        break;

                    case "RARL": tdResearchLead.InnerHtml = Convert.ToString(dr["AssessorName"]);
                        tdResearchLeadFee.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                        trRLAss.Visible = true;
                        trRLAssFee.Visible = true;
                        break;

                    case "AD": tdAuditor.InnerHtml = Convert.ToString(dr["AssessorName"]);
                        tdAuditorFee.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                        trAuditor.Visible = true;
                        trAuditorFee.Visible = true;
                        break;

                    case "IE": tdIndustryExpert.InnerHtml = Convert.ToString(dr["AssessorName"]);
                        tdExpertFee.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                        trIExpert.Visible = true;
                        trIExpertFee.Visible = true;
                        break;

                    case "IQKSMG": string IsOutOfExpense = Convert.ToString(dr["IsOutOfExpense"]);
                        //if(IsOutOfExpense =="A")
                        //{
                        //    tdPortalAdminExp.InnerHtml = Convert.ToString(dr["FeeAmt"]);

                        //}
                        //if (IsOutOfExpense == "O")
                        //{
                        //   tdTotalOExpenses.InnerHtml = Convert.ToString(dr["FeesAmt"]);

                        //}
                        switch (IsOutOfExpense)
                        {

                            case "O ": tdTotalOExpenses.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                                break;

                            case "A ": tdPortalAdminExpFee.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                                break;


                            case "": tdIqksManager.InnerHtml = Convert.ToString(dr["FeesAmt"]);
                                break;
                        }

                        break;


                }

            }

            string portalAdmin = Convert.ToString(usertable1.Rows[0]["PortalAdministrationRemark"]);
            if (portalAdmin == "")
            {
                tdPortalAdminExp.InnerHtml = "&nbsp;&nbsp;-";
            }
            else
            {
                tdPortalAdminExp.InnerHtml = Convert.ToString(usertable1.Rows[0]["PortalAdministrationRemark"]);
            }

            tdTotalFee.InnerHtml = Convert.ToString(usertable1.Rows[0]["TotalFees"]);
            string currencyDate = Convert.ToString(usertable1.Rows[0]["CurrencyDate"]);
            if (currencyDate == "")
            {
                tdDateAllocAssess.InnerHtml = "&nbsp;&nbsp;-";

            }
            else
            {
                tdDateAllocAssess.InnerHtml = Convert.ToString(usertable1.Rows[0]["CurrencyDate"]);
            }
            string currencyRate = Convert.ToString(usertable1.Rows[0]["CurrencyRate"]);
            if (currencyRate == "")
            {
                tdCurrencyRate.InnerHtml = "&nbsp;&nbsp;-";

            }
            else
            {
                tdCurrencyRate.InnerHtml = Convert.ToString(usertable1.Rows[0]["CurrencyRate"]);
            }
            //tdCurrencyRate.InnerHtml = Convert.ToString(usertable1.Rows[0]["CurrencyRate"]);
            tdGrandTotalFees.InnerHtml = Convert.ToString(usertable1.Rows[0]["GrossTotalFees"]);
            tdCurrencyType.InnerHtml = Convert.ToString(usertable1.Rows[0]["CurrencType"]);
            string CandidateType = Convert.ToString(usertable1.Rows[0]["CandidateRole"]);
            if (CandidateType == "CANR")
            {
                trModAss.Visible = false;
                trModAssFee.Visible = false;
            }
            if (CandidateType == "CANM")
            {
                trRLAss.Visible = false;
                trRLAssFee.Visible = false;
            }
        }
    }
    protected void gvCandidateSelectAssessordate_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        int rwIndex = 0;
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            rwIndex = e.Row.RowIndex + (gvCandidateSelectAssessordate.PageSize * gvCandidateSelectAssessordate.PageIndex);
            DataTable DtObj = (DataTable)gvCandidateSelectAssessordate.DataSource;
            CheckBox chkApproveFirstHalf = (CheckBox)e.Row.FindControl("chkApproveFirstHalf");
            CheckBox chkApproveSecondHalf = (CheckBox)e.Row.FindControl("chkApproveSecondHalf");
            CheckBox chkCandidateFirstHalf = (CheckBox)e.Row.FindControl("chkCandidateFirstHalf");
            CheckBox chkCandidateSecondHalf = (CheckBox)e.Row.FindControl("chkCandidateSecondHalf");
            Label lblFHHour = (Label)e.Row.FindControl("lblFHHour");
            Label lblFHMinute = (Label)e.Row.FindControl("lblFHMinute");
            Label lblSHHour = (Label)e.Row.FindControl("lblSHHour");
            Label lblSHMinute = (Label)e.Row.FindControl("lblSHMinute");
            Label lblAssessorCalendarDetailID = (Label)e.Row.FindControl("lblAssessorCalendarDetailID");

            chkApproveFirstHalf.Checked = Convert.ToBoolean(DtObj.Rows[rwIndex]["FirstHalfCheck"]);
            chkApproveSecondHalf.Checked = Convert.ToBoolean(DtObj.Rows[rwIndex]["SecondHalfCheck"]);
            lblAssessorCalendarDetailID.Text = DtObj.Rows[rwIndex]["AssessorCalendarDetailID"].ToString();

            lblFHHour.Text = TimeSpan.Parse(DtObj.Rows[rwIndex]["FirstHalfTime"].ToString()).Hours.ToString("00");
            lblFHMinute.Text = TimeSpan.Parse(DtObj.Rows[rwIndex]["FirstHalfTime"].ToString()).Minutes.ToString("00");
            lblSHHour.Text = CommonUtility.GetHour(TimeSpan.Parse(DtObj.Rows[rwIndex]["SecondHalfTime"].ToString()).Hours).ToString("00");
            lblSHMinute.Text = TimeSpan.Parse(DtObj.Rows[rwIndex]["SecondHalfTime"].ToString()).Minutes.ToString("00");

            chkCandidateFirstHalf.Checked = Convert.ToBoolean(DtObj.Rows[rwIndex]["CandidateFirstHalfCheck"]);
            chkCandidateSecondHalf.Checked = Convert.ToBoolean(DtObj.Rows[rwIndex]["CandidateSecondHalfCheck"]);

            chkCandidateFirstHalf.Enabled = false;
            chkCandidateSecondHalf.Enabled = false;

            chkApproveFirstHalf.Enabled = false;
            chkApproveSecondHalf.Enabled = false;

        }
    }
    protected void mainMenu_MenuItemClick(object sender, MenuEventArgs e)
    {
        int intActiveIndex;
        if (e != null)
        {
            mvwCandidateBriefDetails.ActiveViewIndex = Int32.Parse(e.Item.Value);
        }

        intActiveIndex = mvwCandidateBriefDetails.ActiveViewIndex;
    }

    #endregion



    //all candidate type
    private DataSet GetCandidateBriefReviewDetails()
    {
        DataSet objDs = null;
        try
        {
            objDs = new CandidateBriefDetailsAuditorBAL().GetCandidateBriefDetailByCandidateID(Convert.ToInt64(hdnCandidateID.Value), Convert.ToInt16(hdnBriefID.Value));
        }
        catch (Exception exception)
        {
            exception.AddErrorToLog();// throw new ApplicationException(exception.Message);
        }
        return objDs;

    }



    protected void rbQuestionYes_CheckedChanged(object sender, EventArgs e)
    {
        QuestionM1.Visible = true;
        QuestionM2.Visible = true;
        QuestionM3.Visible = true;
        QuestionM4.Visible = true;
        trMQuestion1.Visible = true;
        trMQuestion2.Visible = true;
    }
    protected void rbQuestionNo_CheckedChanged(object sender, EventArgs e)
    {
        QuestionM1.Visible = false;
        QuestionM2.Visible = false;
        QuestionM3.Visible = false;
        QuestionM4.Visible = false;
        trMQuestion1.Visible = false;
        trMQuestion2.Visible = false;
    }


    protected void rbReviewDocumentYes_CheckedChanged(object sender, EventArgs e)
    {
        trReview1.Visible = true;
        trReview2.Visible = true;
        trReview3.Visible = true;

        trReviewfile2.Visible = true;

        trReview5.Visible = true;
        trReview6.Visible = true;

    }
    protected void rbReviewDocumentNo_CheckedChanged(object sender, EventArgs e)
    {
        trReview1.Visible = false;
        trReview2.Visible = false;
        trReview3.Visible = false;

        trReviewfile2.Visible = true;


        trReview5.Visible = false;
        trReview6.Visible = false;
    }
    protected void cstMReviewDocument_ServerValidate(object source, ServerValidateEventArgs args)
    {

        if (fuMReviewDocument.PostedFile == null)
        {
            args.IsValid = false;
            cstMReviewDocument.ErrorMessage = "Select file to attach.";
            return;
        }
        else
        {
            if (fuMReviewDocument.PostedFile.FileName == "")
            {
                args.IsValid = false;
                cstMReviewDocument.ErrorMessage = "Select file to attach.";
                return;
            }
            else if (fuMReviewDocument.PostedFile.FileName != "")
            {
                /*check file is valid*/
                if (fuMReviewDocument.PostedFile.ContentLength == 0)
                {
                    args.IsValid = false;
                    cstMReviewDocument.ErrorMessage = "Select Valid file.";
                    return;
                }

                string pattern = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileName"]);
                Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
                Match match = regex.Match(Path.GetFileNameWithoutExtension(fuMReviewDocument.FileName));

                if (!match.Success)
                {
                    args.IsValid = false;
                    cstMReviewDocument.ErrorMessage = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileNameErrorMsg"]);
                    return;
                }
                /*Check file name has extension*/
                if (System.IO.Path.HasExtension(fuMReviewDocument.PostedFile.FileName) == true)
                {

                    /*check void extension are there or not*/
                    if (CommonUtility.CheckExtension(Path.GetExtension(fuMReviewDocument.PostedFile.FileName), Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"])) == false)
                    {
                        args.IsValid = false;
                        cstMReviewDocument.ErrorMessage = "Upload File failed. Select file format as per below.";
                        return;
                    }

                }
            }
        }
    }



    protected void rbRLNo_CheckedChanged(object sender, EventArgs e)
    {
        trRLReview1.Visible = false;
        trRLReview2.Visible = false;

        trRLReview3.Visible = false;
        trRLReview11.Visible = false;

        trRLAddQuesionSpace2.Visible = false;

        trRLAddQuesionSpace1.Visible = false;
    }

    protected void rbRLYes_CheckedChanged(object sender, EventArgs e)
    {
        trRLReview1.Visible = true;
        trRLReview2.Visible = true;

        trRLReview3.Visible = true;
        trRLReview11.Visible = true;
        trRLAddQuesionSpace1.Visible = true;
        trRLAddQuesionSpace2.Visible = true;
    }

    protected void cstRLReviewDocument_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (fuReviewDocument.PostedFile == null)
        {
            args.IsValid = false;
            cstRLReviewDocument.ErrorMessage = "Select file to attach.";
            return;
        }
        else
        {
            if (fuReviewDocument.PostedFile.FileName == "")
            {
                args.IsValid = false;
                cstRLReviewDocument.ErrorMessage = "Select file to attach.";
                return;
            }
            else if (fuReviewDocument.PostedFile.FileName != "")
            {
                /*check file is valid*/
                if (fuReviewDocument.PostedFile.ContentLength == 0)
                {
                    args.IsValid = false;
                    cstRLReviewDocument.ErrorMessage = "Select Valid file.";
                    return;
                }
                string pattern = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileName"]);
                Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
                Match match = regex.Match(Path.GetFileNameWithoutExtension(fuReviewDocument.FileName));

                if (!match.Success)
                {
                    args.IsValid = false;
                    cstRLReviewDocument.ErrorMessage = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileNameErrorMsg"]);
                    return;
                }
                /*Check file name has extension*/
                if (System.IO.Path.HasExtension(fuReviewDocument.PostedFile.FileName) == true)
                {

                    /*check void extension are there or not*/
                    if (CommonUtility.CheckExtension(Path.GetExtension(fuReviewDocument.PostedFile.FileName), Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"])) == false)
                    {
                        args.IsValid = false;
                        cstRLReviewDocument.ErrorMessage = "Upload File failed. Select file format as per below.";
                        return;
                    }

                }
            }
        }
    }
    protected void rbReviewDocNo_CheckedChanged(object sender, EventArgs e)
    {
        trRLReview4.Visible = false;
        trRLReview5.Visible = false;
        trRLReview7.Visible = false;
        trRLReview8.Visible = false;
        trRLReview9.Visible = false;
        trRLReview6.Visible = false;
    }
    protected void rbReviewDocYes_CheckedChanged(object sender, EventArgs e)
    {
        trRLReview4.Visible = true;
        trRLReview5.Visible = true;
        trRLReview7.Visible = true;
        trRLReview8.Visible = true;
        trRLReview9.Visible = true;
        trRLReview6.Visible = true;
    }

    protected void btnAddMReview_Click(object sender, EventArgs e)
    {
        //Usp_SetAssessorReview


        //string strAprRej = ddlMReviewStatus.SelectedValue.Trim();

        //if (strAprRej == "10" || strAprRej == "11")
        //{

        //   confirm('Please Confirm ')
        //}
        if (Page.IsValid == true)
        {
            try
            {
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();
                string strReturnValue = string.Empty;


                strReturnValue = (string)objCandidateBriefDetailsAuditorBAL.SetCandidateBriefReview(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), Convert.ToInt16(hdnCandidateStatus.Value), ddlMReviewStatus.SelectedValue, txtMReviewComment.Text.Trim(), Convert.ToInt32(ddlAccreditationType.SelectedValue));

                if (Convert.ToInt16(ddlMReviewStatus.SelectedValue) != 27)
                {
                    gvMDocument.Columns[2].Visible = false;
                    btnAddMReview.Enabled = false;
                    gvMReviewFile.Visible = false;
                    btnAddMReview.Visible = false;
                    btnMUpload.Enabled = false;
                    btnMUpload.Visible = false;
                    //btnCancelMReview.Enabled = false;
                    fuMReviewDocument.Enabled = false;
                    txtMReviewComment.Enabled = false;
                    ddlMReviewStatus.Enabled = false;
                }

            }
            catch (Exception ex)
            {


            }
            finally
            {

                Response.Redirect("CandidateBriefAuditorThank.aspx?page=M&statusid=" + CommonUtility.Encrypt(Convert.ToString(ddlMReviewStatus.SelectedValue),true));
                // ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Moderator Assessor - Review Document Added Successfully.');", true);
            }
        }

    }

    protected void btnIEAddReview_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();
                string strReturnValue = string.Empty;

                strReturnValue = (string)objCandidateBriefDetailsAuditorBAL.SetCandidateBriefReview(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), Convert.ToInt16(hdnCandidateStatus.Value), ddlIEReviewComment.SelectedValue, txtIEReviewComment.Text.Trim(), Convert.ToInt32(ddlAccreditationType.SelectedValue));
                if (strReturnValue != "ERROR")
                {

                    if (Convert.ToInt16(ddlIEReviewComment.SelectedValue) != 30)
                    {

                        //gvIEReview.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), 9);
                        //gvIEReview.DataBind();
                        gvIEReview.Visible = false;
                        btnIEAddReview.Enabled = false;
                        btnIEAddReview.Visible = false;
                        //btnIECancelReview.Enabled = false;
                        fuIEReview.Enabled = false;
                        txtIEReviewComment.Enabled = false;
                        ddlIEReviewComment.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {

            }
            finally
            {
                Response.Redirect("CandidateBriefAuditorThank.aspx?page=IE&statusid=" + CommonUtility.Encrypt(Convert.ToString(ddlIEReviewComment.SelectedValue),true));
            }
        }

    }


    protected void rbAuditor_CheckedChanged(object sender, EventArgs e)
    {

    }


    protected void rbAuditorYes_CheckedChanged(object sender, EventArgs e)
    {
        trAuditor5.Visible = true;
        trAuditor6.Visible = true;
        trAuditor10.Visible = true;
        trAuditor7.Visible = true;
        trAuditor8.Visible = true;
        trAuditor9.Visible = true;
    }


    protected void rbAuditorNo_CheckedChanged(object sender, EventArgs e)
    {
        trAuditor5.Visible = false;
        trAuditor6.Visible = false;
        trAuditor10.Visible = false;
        trAuditor7.Visible = false;
        trAuditor8.Visible = false;
        trAuditor9.Visible = false;
    }
    protected void cstAuditorReview_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (fuAuditorReview.PostedFile == null)
        {
            args.IsValid = false;
            cstAuditorReview.ErrorMessage = "Select file to attach.";
            return;
        }
        else
        {
            if (fuAuditorReview.PostedFile.FileName == "")
            {
                args.IsValid = false;
                cstAuditorReview.ErrorMessage = "Select file to attach.";
                return;
            }
            else if (fuAuditorReview.PostedFile.FileName != "")
            {
                /*check file is valid*/
                if (fuAuditorReview.PostedFile.ContentLength == 0)
                {
                    args.IsValid = false;
                    cstAuditorReview.ErrorMessage = "Select Valid file.";
                    return;
                }

                string pattern = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileName"]);
                Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
                Match match = regex.Match(Path.GetFileNameWithoutExtension(fuAuditorReview.FileName));

                if (!match.Success)
                {
                    args.IsValid = false;
                    cstAuditorReview.ErrorMessage = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileNameErrorMsg"]);
                    return;
                }
                /*Check file name has extension*/
                if (System.IO.Path.HasExtension(fuAuditorReview.PostedFile.FileName) == true)
                {

                    /*check void extension are there or not*/
                    if (CommonUtility.CheckExtension(Path.GetExtension(fuAuditorReview.PostedFile.FileName), Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"])) == false)
                    {
                        args.IsValid = false;
                        cstAuditorReview.ErrorMessage = "Upload File failed. Select file format as per below.";
                        return;
                    }

                }
            }
        }
    }


    protected void btnRLADD_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();
                string strReturnValue = string.Empty;

                strReturnValue = (string)objCandidateBriefDetailsAuditorBAL.SetCandidateBriefReview(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), Convert.ToInt16(hdnCandidateStatus.Value), ddlRLReviewStatus.SelectedValue, txtRLReviewComment.Text.Trim(), Convert.ToInt32(ddlAccreditationType.SelectedValue));
                if (strReturnValue != "ERROR")
                {
                    gvRLReviewFile.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), 7);
                    gvRLReviewFile.DataBind();

                    if (Convert.ToInt16(ddlRLReviewStatus.SelectedValue) != 28)
                    {
                        btnRLADD.Enabled = false;
                        btnRLADD.Visible = false;
                        //btnRLCancel.Enabled = false;
                        fuReviewDocument.Enabled = false;
                        txtRLReviewComment.Enabled = false;
                        ddlRLReviewStatus.Enabled = false;
                    }

                }
            }
            catch (Exception ex)
            {


            }
            finally
            {
                Response.Redirect("CandidateBriefAuditorThank.aspx?page=RL&statusid=" + CommonUtility.Encrypt(Convert.ToString(ddlRLReviewStatus.SelectedValue),true));
                //ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Research Lead Assessor - Review Document Added Successfully.');", true);
            }
        }
    }

    protected void btnAuditorReview_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();

                string strReturnValue = string.Empty;

                strReturnValue = (string)objCandidateBriefDetailsAuditorBAL.SetCandidateBriefReview(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), Convert.ToInt16(hdnCandidateStatus.Value), ddlAuditorReview.SelectedValue, txtAuditorReviewComment.Text.Trim(), Convert.ToInt32(ddlAccreditationType.SelectedValue));
                if (strReturnValue != "ERROR")
                {

                    gvADReviewFile.DataSource = objCandidateBriefDetailsAuditorBAL.GetCandidateReviewDocumentByDocumentType(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), 8);
                    gvADReviewFile.DataBind();

                    if (Convert.ToInt16(ddlAuditorReview.SelectedValue) != 29)
                    {
                        btnAuditorReview.Enabled = false;
                        btnAuditorReview.Visible = false;
                        //btnAuditorReviewCancel.Enabled = false;
                        fuAuditorReview.Enabled = false;
                        txtAuditorReviewComment.Enabled = false;
                        ddlAuditorReview.Enabled = false;
                        //Added by Prashant
                        ddlAccreditationType.Enabled = false;
                    }

                }
            }
            catch (Exception ex)
            {

            }
            finally
            {
                Response.Redirect("CandidateBriefAuditorThank.aspx?page=AD&statusid=" + CommonUtility.Encrypt(Convert.ToString(ddlAuditorReview.SelectedValue),true));

                // ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Auditor - Review Document Added Successfully.');", true);
            }
        }
    }
    protected void rbRLQuesYes_CheckedChanged(object sender, EventArgs e)
    {

        trAuditor1.Visible = true;
        trAuditor2.Visible = true;

        trAuditor3.Visible = true;
        trAuditor4.Visible = true;
        trAuditorQuesion1.Visible = true;
        trAuditorQuesion2.Visible = true;

    }
    protected void rbRLQuesNo_CheckedChanged(object sender, EventArgs e)
    {
        trAuditor1.Visible = false;
        trAuditor2.Visible = false;

        trAuditor3.Visible = false;
        trAuditor4.Visible = false;

        trAuditorQuesion1.Visible = false;
        trAuditorQuesion2.Visible = false;

    }

    protected void rbIEQuestionYes_CheckedChanged(object sender, EventArgs e)
    {
        trIE1.Visible = true;
        trIE2.Visible = true;
        trIE3.Visible = true;
        trIE4.Visible = true;
        trIEQuestion1.Visible = true;
        trIEQuestion2.Visible = true;
    }
    protected void rbIEQuestionNo_CheckedChanged(object sender, EventArgs e)
    {
        trIE1.Visible = false;
        trIE2.Visible = false;
        trIE3.Visible = false;
        trIE4.Visible = false;
        trIEQuestion1.Visible = false;
        trIEQuestion2.Visible = false;
    }


    protected void rbRdYes_CheckedChanged(object sender, EventArgs e)
    {
        trRD1.Visible = true;
        trRD2.Visible = true;

        trRD3.Visible = true;
        trRD8.Visible = true;
        trRDQuestion1.Visible = true;
        trRDQuestion2.Visible = true;
    }
    protected void rbRdNo_CheckedChanged(object sender, EventArgs e)
    {
        trRD1.Visible = false;
        trRD2.Visible = false;

        trRD3.Visible = false;
        trRD8.Visible = false;
        trRDQuestion1.Visible = false;
        trRDQuestion2.Visible = false;
    }
    protected void btnAddRegD_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();
                string strReturnValue = string.Empty;

                strReturnValue = (string)objCandidateBriefDetailsAuditorBAL.SetCandidateBriefReview(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), Convert.ToInt16(hdnCandidateStatus.Value), ddlRDStatus.SelectedValue, txtRDRevComm.Text.Trim(), Convert.ToInt32(ddlAccreditationType.SelectedValue));
                if (strReturnValue != "ERROR")
                {
                    btnAddRegD.Enabled = false;
                    btnAddRegD.Visible = false;
                    //btnCancelRegD.Enabled = false;
                    txtRDRevComm.Enabled = false;
                    ddlRDStatus.Enabled = false;
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                Response.Redirect("CandidateBriefAuditorThank.aspx?page=RD&statusid=" + CommonUtility.Encrypt(Convert.ToString(ddlRDStatus.SelectedValue),true));


                // ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Regional Director Review completed.');", true);
            }
        }
    }


    protected void rdGdYes_CheckedChanged(object sender, EventArgs e)
    {
        trGD1.Visible = true;
        trGD2.Visible = true;
        trGD3.Visible = true;
        trGD4.Visible = true;
        trGDAddQuestion2.Visible = true;
        trGDAddQuestion1.Visible = true;

    }
    protected void rdGdNo_CheckedChanged(object sender, EventArgs e)
    {
        trGD1.Visible = false;
        trGD2.Visible = false;
        trGD3.Visible = false;
        trGD4.Visible = false;
        trGDAddQuestion2.Visible = false;
        trGDAddQuestion1.Visible = false;

    }
    protected void btnGlobalAdd_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                CandidateBriefDetailsAuditorBAL objCandidateBriefDetailsAuditorBAL = new CandidateBriefDetailsAuditorBAL();
                string strReturnValue = string.Empty;
                //  strReturnValue = (string)objCandidateBriefDetailsAuditorBAL.SetCandidateBriefReview(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), Convert.ToInt16(hdnCandidateStatus.Value), ddlRevStatus.SelectedValue, -1, "", "", txtGDReviewComment.Text.Trim(), Convert.ToInt32(ddlAccreditationType.SelectedValue));
                if (strReturnValue != "ERROR")
                {
                    btnGlobalAdd.Enabled = false;
                    btnGlobalAdd.Visible = false;
                    //btnGlobalCancel.Enabled = false;
                    txtGDReviewComment.Enabled = false;
                    ddlRevStatus.Enabled = false;
                }
            }
            catch (Exception ex)
            {

            }
            finally
            {


                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Global Director - Review Document Added Successfully.');", true);
            }
        }
    }


    protected void btnAddQuestion_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveMoreDetails(Convert.ToInt32(hdnCandidateQueryID.Value), 1, txtAssessorComments.Text.Trim());
                txtAssessorComments.Enabled = false;
                btnAddQuestion.Enabled = false;
                btnAddQuestion.Visible = false;
                btnCancelQuestion.Enabled = false;
                btnCancelQuestion.Visible = false;
                lblBriefDetailsAssCommentsysDate.Text = Convert.ToString(System.DateTime.Now);
                tdBriefMessage.InnerHtml = "<font color='green'><b>Comments has been added successfully.</b></font>";
            }
            catch (Exception ex)
            {

            }
            finally
            {


                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }

    private string SaveMoreDetails(int intQueryID, int intQueryTypeID, string strComment)
    {
        CandidateBriefDetailBAL objCBDBAL = new CandidateBriefDetailBAL();
        string strReturnValue;

        strReturnValue = (string)objCBDBAL.SetCandidateMoreComments(intQueryID, CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), intQueryTypeID, strComment);
        return strReturnValue;
    }



    protected void btnAddComment_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveQuestionTo(2, txtQuestionForMCan.Text.Trim());
                btnAddComment.Enabled = false;
                btnAddComment.Visible = false;
                btnCancelComment.Enabled = false;
                btnCancelComment.Visible = false;
                rbMQuestionYes.Checked = true;
                rbMQuestionYes.Enabled = false;
                rbMQuestionNo.Enabled = false;
                txtQuestionForMCan.Enabled = false;
                lblModAssReviewQueforCandidateSysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {

            }
            finally
            {


                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }

    private string SaveQuestionTo(int intQueryTypeID, string strQuestion)
    {
        CandidateBriefDetailsAuditorBAL objCBDBAL = new CandidateBriefDetailsAuditorBAL();
        string strReturnValue;
        strReturnValue = (string)objCBDBAL.SetAssessorQuery(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Convert.ToInt32(hdnBriefID.Value), intQueryTypeID, strQuestion);
        return strReturnValue;
    }

    protected void cstMQuestionCan_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (rbMQuestionYes.Checked == true)
        {
            if (txtQuestionForMCan.Enabled == true)
            {
                args.IsValid = false;
                cstMQuestionCan.ErrorMessage = "Add Question for Candidate.";
                return;
            }
        }
    }
    protected void btnRLAddQuestion_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveQuestionTo(3, txtQuestionM.Text.Trim());
                btnRLAddQuestion.Enabled = false;
                btnRLAddQuestion.Visible = false;
                btnRLAddCancel.Enabled = false;
                btnRLAddCancel.Visible = false;
                rbRLYes.Checked = true;
                rbRLYes.Enabled = false;
                rbRLNo.Enabled = false;
                txtQuestionM.Enabled = false;
                lblRLAssReviewQueForModAsssysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {

            }
            finally
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }
    protected void cstQuestionRL_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (rbRLYes.Checked == true)
        {
            if (txtQuestionM.Enabled == true)
            {
                args.IsValid = false;
                cstQuestionRL.ErrorMessage = "Add Question for Moderator Assessor.";
                return;
            }
        }
    }

    protected void btnAddAuditorQuest_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveQuestionTo(4, txtQuestionRL.Text.Trim());
                btnAddAuditorQuest.Enabled = false;
                btnAddAuditorQuest.Visible = false;
                btnCancelAuditorQuest.Enabled = false;
                btnCancelAuditorQuest.Visible = false;
                rbRLQuesYes.Checked = true;
                rbRLQuesYes.Enabled = false;
                rbRLQuesNo.Enabled = false;
                txtQuestionRL.Enabled = false;
                lblAuditorReviewQueforRLSysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {

            }
            finally
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }
    protected void cstQuestionRLead_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (rbRLQuesYes.Checked == true)
        {
            if (txtQuestionRL.Enabled == true)
            {
                args.IsValid = false;
                cstQuestionRLead.ErrorMessage = "Add Question for Research Lead.";
                return;
            }
        }
    }
    protected void btnIEQuestion_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveQuestionTo(5, txtQusForAuti.Text.Trim());
                btnIEQuestion.Enabled = false;
                btnIEQuestion.Visible = false;
                btnIEQuestionCancel.Enabled = false;
                btnIEQuestionCancel.Visible = false;
                rbIEQuestionYes.Checked = true;
                rbIEQuestionYes.Enabled = false;
                rbIEQuestionNo.Enabled = false;
                txtQusForAuti.Enabled = false;
                lblIndExpQueforAuditorsysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }
    protected void cstQuetionForRL_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (rbIEQuestionYes.Checked == true)
        {
            if (txtQusForAuti.Enabled == true)
            {
                args.IsValid = false;
                cstQuetionForRL.ErrorMessage = "Add Question for Auditor.";
                return;
            }
        }
    }

    protected void cstIEReview_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (fuIEReview.PostedFile == null)
        {
            args.IsValid = false;
            cstIEReview.ErrorMessage = "Select file to attach.";
            return;
        }
        else
        {
            if (fuIEReview.PostedFile.FileName == "")
            {
                args.IsValid = false;
                cstIEReview.ErrorMessage = "Select file to attach.";
                return;
            }
            else if (fuIEReview.PostedFile.FileName != "")
            {
                /*check file is valid*/
                if (fuIEReview.PostedFile.ContentLength == 0)
                {
                    args.IsValid = false;
                    cstIEReview.ErrorMessage = "Select Valid file.";
                    return;
                }

                string pattern = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileName"]);
                Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
                Match match = regex.Match(Path.GetFileNameWithoutExtension(fuIEReview.FileName));

                if (!match.Success)
                {
                    args.IsValid = false;
                    cstIEReview.ErrorMessage = Convert.ToString(ConfigurationManager.AppSettings["DocumentFileNameErrorMsg"]);
                    return;
                }
                /*Check file name has extension*/
                if (System.IO.Path.HasExtension(fuIEReview.PostedFile.FileName) == true)
                {

                    /*check void extension are there or not*/
                    if (CommonUtility.CheckExtension(Path.GetExtension(fuIEReview.PostedFile.FileName), Convert.ToString(ConfigurationManager.AppSettings["ReviewFileType"])) == false)
                    {
                        args.IsValid = false;
                        cstIEReview.ErrorMessage = "Upload File failed. Select file format as per below.";
                        return;
                    }

                }
            }
        }
    }


    protected void btnIECancelReview_Click(object sender, EventArgs e)
    {

    }
    protected void btnRDADDQuestion_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveQuestionTo(6, txtIEQus.Text.Trim());
                btnRDADDQuestion.Enabled = false;
                btnRDADDQuestion.Visible = false;
                btnRDCancelQuestion.Enabled = false;
                btnRDCancelQuestion.Visible = false;
                rbRdYes.Checked = true;
                rbRdYes.Enabled = false;
                rbRdNo.Enabled = false;
                txtIEQus.Enabled = false;
                lblRegDirQueforIndExpsysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {

            }
            finally
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }
    protected void cstIEQus_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (rbRdYes.Checked == true)
        {
            if (txtIEQus.Enabled == true)
            {
                args.IsValid = false;
                cstIEQus.ErrorMessage = "Add Question for Industory Expert.";
                return;
            }
        }
    }
    protected void btnAddGDAddQuestion_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveQuestionTo(7, txtGDQuestion.Text.Trim());
                btnAddGDAddQuestion.Enabled = false;
                btnAddGDAddQuestion.Visible = false;
                btnCancelGDAddQuestion.Enabled = false;
                btnCancelGDAddQuestion.Visible = false;
                rdGdYes.Checked = true;
                rdGdYes.Enabled = false;
                rdGdNo.Enabled = false;
                txtGDQuestion.Enabled = false;
                lblGlobalDirQueforRegDirSysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }
    protected void cstGDQuestion_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (rdGdYes.Checked == true)
        {
            if (txtGDQuestion.Enabled == true)
            {
                args.IsValid = false;
                cstGDQuestion.ErrorMessage = "Add Question for Regional Director.";
                return;
            }
        }
    }
    protected void btnMoreAdd_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            try
            {
                SaveMoreDetails(Convert.ToInt32(hdnMoreQueryID.Value), Convert.ToInt32(hdnMoreQueryTypeID.Value), txtModeratorComment.Text.Trim());
                txtModeratorComment.Enabled = false;
                btnMoreAdd.Enabled = false;
                btnMoreAdd.Visible = false;
                btnMoreCancel.Enabled = false;
                btnMoreCancel.Visible = false;
                lblMoreDetailsYourCommentsysDate.Text = Convert.ToString(System.DateTime.Now);
            }
            catch (Exception ex)
            {

            }
            finally
            {


                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Questions/Comments Added Successfully.');", true);
            }
        }
    }

    protected void btnCancelQuestion_Click(object sender, EventArgs e)
    {
        txtAssessorComments.Text = string.Empty;
    }

    protected void btnMUpload_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SaveDocument(6, hdnModUserID.Value);
        }
    }
    protected void gvMDocument_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lnkButton = (LinkButton)e.Row.FindControl("lnkDelete");

            lnkButton.Attributes.Add("onclick", "javascript:return " + "confirm('Are you sure you want to delete?')");

        }
    }
    protected void gvMDocument_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        if (gvMDocument.Rows.Count != 1)
        {


            long intDocID = (long)gvMDocument.DataKeys[e.RowIndex].Value;
            CandidateAllocateAssessorBAL objCBDBAL = new CandidateAllocateAssessorBAL();
            string strReturnValue = string.Empty;
            strReturnValue = DeleteReviewDocuments(intDocID, 6, Guid.Parse(hdnModUserID.Value));

            if (strReturnValue == "SUCCESS")
            {
                gvMDocument.DataSource = objCBDBAL.GetAssessorDocument(6, Guid.Parse(hdnModUserID.Value), Convert.ToInt64(hdnCandidateBriefId.Value));
                gvMDocument.DataBind();
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Please add another document before deleting this document.');", true);
        }
    }


    private string DeleteReviewDocuments(long intDeleteDocument, int intDocumentTypeID, Guid strAssessorUserid)
    {
        CandidateBriefDetailsAuditorBAL objCandidateBriefDetailBAL = new CandidateBriefDetailsAuditorBAL();
        string strReturnValue;
        strReturnValue = (string)objCandidateBriefDetailBAL.SetDeleteAssessorReviewDocument(CommonUtility.GetLoggedOnUserId(), intDeleteDocument, strAssessorUserid, hdnCandidateBriefId.Value);
        return strReturnValue;
    }

    protected void cstMReviewDocumentSubmit_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (gvMDocument.Rows.Count <= 0)
        {
            args.IsValid = false;
            cstMReviewDocumentSubmit.ErrorMessage = "Upload review documents.";
            return;
        }
    }

    private void SaveDocument(Int16 intFileType, string strAssessorUserid)
    {
        string strPath = string.Empty;
        string strFileExt = string.Empty;
        string strFileName = string.Empty;
        CandidateAllocateAssessorBAL objCBDBAL = new CandidateAllocateAssessorBAL();
        strPath = MapPath(Convert.ToString(ConfigurationManager.AppSettings["ReviewPath"]));
        try
        {
            if (intFileType == 6)
            {
                strFileExt = Path.GetExtension(fuMReviewDocument.PostedFile.FileName);
                strFileName = Path.GetFileNameWithoutExtension(fuMReviewDocument.FileName);
                strFileName = (string)objCBDBAL.SetAssessorDocument(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Guid.Parse(strAssessorUserid), Convert.ToInt16(hdnBriefID.Value), intFileType, strFileName, strFileExt);
                //fuMReviewDocument.SaveAs(strPath + strFileName);
                CommonUtility.SaveFile(fuMReviewDocument, strPath, strFileName);
                if (strFileName != "ERROR")
                {
                    gvMDocument.DataSource = objCBDBAL.GetAssessorDocument(intFileType, Guid.Parse(strAssessorUserid), Convert.ToInt64(hdnCandidateBriefId.Value));
                    gvMDocument.DataBind();
                }
            }
            else if (intFileType == 7)
            {
                strFileExt = Path.GetExtension(fuReviewDocument.PostedFile.FileName);
                strFileName = Path.GetFileNameWithoutExtension(fuReviewDocument.FileName);
                strFileName = (string)objCBDBAL.SetAssessorDocument(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Guid.Parse(strAssessorUserid), Convert.ToInt16(hdnBriefID.Value), intFileType, strFileName, strFileExt);
                //fuReviewDocument.SaveAs(strPath + strFileName);
                CommonUtility.SaveFile(fuReviewDocument, strPath, strFileName);
                if (strFileName != "ERROR")
                {
                    gvRLDocument.DataSource = objCBDBAL.GetAssessorDocument(intFileType, Guid.Parse(strAssessorUserid), Convert.ToInt64(hdnCandidateBriefId.Value));
                    gvRLDocument.DataBind();
                }
            }
            else if (intFileType == 8)
            {
                strFileExt = Path.GetExtension(fuAuditorReview.PostedFile.FileName);
                strFileName = Path.GetFileNameWithoutExtension(fuAuditorReview.FileName);
                strFileName = (string)objCBDBAL.SetAssessorDocument(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Guid.Parse(strAssessorUserid), Convert.ToInt16(hdnBriefID.Value), intFileType, strFileName, strFileExt);
                //fuAuditorReview.SaveAs(strPath + strFileName);
                CommonUtility.SaveFile(fuAuditorReview, strPath, strFileName);
                if (strFileName != "ERROR")
                {
                    gvADDocument.DataSource = objCBDBAL.GetAssessorDocument(intFileType, Guid.Parse(strAssessorUserid), Convert.ToInt64(hdnCandidateBriefId.Value));
                    gvADDocument.DataBind();
                }
            }
            else if (intFileType == 9)
            {
                strFileExt = Path.GetExtension(fuIEReview.PostedFile.FileName);
                strFileName = Path.GetFileNameWithoutExtension(fuIEReview.FileName);
                strFileName = (string)objCBDBAL.SetAssessorDocument(CommonUtility.GetLoggedOnUserId(), Convert.ToInt32(hdnCandidateBriefId.Value), Convert.ToInt32(hdnCandidateID.Value), Guid.Parse(strAssessorUserid), Convert.ToInt16(hdnBriefID.Value), intFileType, strFileName, strFileExt);
                //fuIEReview.SaveAs(strPath + strFileName);
                CommonUtility.SaveFile(fuIEReview, strPath, strFileName);
                if (strFileName != "ERROR")
                {
                    gvIEReviewFile.DataSource = objCBDBAL.GetAssessorDocument(intFileType, Guid.Parse(strAssessorUserid), Convert.ToInt64(hdnCandidateBriefId.Value));
                    gvIEReviewFile.DataBind();
                }
            }


        }
        catch (Exception ex)
        {

        }
        finally
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Document Added Successfully.');", true);
        }
    }
    protected void cstRLReviewDocumentSubmit_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (gvRLDocument.Rows.Count <= 0)
        {
            args.IsValid = false;
            cstRLReviewDocumentSubmit.ErrorMessage = "Upload review documents.";
            return;
        }
    }
    protected void btnRLUpload_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SaveDocument(7, hdnRLUserID.Value);
        }
    }
    protected void gvRLDocument_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lnkButton = (LinkButton)e.Row.FindControl("lnkDelete");

            lnkButton.Attributes.Add("onclick", "javascript:return " + "confirm('Are you sure you want to delete?')");

        }
    }
    protected void gvRLDocument_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        if (gvRLDocument.Rows.Count != 1)
        {


            long intDocID = (long)gvRLDocument.DataKeys[e.RowIndex].Value;
            CandidateAllocateAssessorBAL objCBDBAL = new CandidateAllocateAssessorBAL();
            string strReturnValue = string.Empty;
            strReturnValue = DeleteReviewDocuments(intDocID, 7, Guid.Parse(hdnRLUserID.Value));

            if (strReturnValue == "SUCCESS")
            {
                gvRLDocument.DataSource = objCBDBAL.GetAssessorDocument(7, Guid.Parse(hdnRLUserID.Value), Convert.ToInt64(hdnCandidateBriefId.Value));
                gvRLDocument.DataBind();
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Please add another document before deleting this document.');", true);
        }
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("../home/Dashboard.aspx");
    }
    protected void gvADDocument_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lnkButton = (LinkButton)e.Row.FindControl("lnkDelete");

            lnkButton.Attributes.Add("onclick", "javascript:return " + "confirm('Are you sure you want to delete?')");

        }
    }
    protected void gvADDocument_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        if (gvADDocument.Rows.Count != 1)
        {


            long intDocID = (long)gvADDocument.DataKeys[e.RowIndex].Value;
            CandidateAllocateAssessorBAL objCBDBAL = new CandidateAllocateAssessorBAL();
            string strReturnValue = string.Empty;
            strReturnValue = DeleteReviewDocuments(intDocID, 8, Guid.Parse(hdnAuditUserID.Value));

            if (strReturnValue == "SUCCESS")
            {
                gvADDocument.DataSource = objCBDBAL.GetAssessorDocument(8, Guid.Parse(hdnAuditUserID.Value), Convert.ToInt64(hdnCandidateBriefId.Value));
                gvADDocument.DataBind();
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Please add another document before deleting this document.');", true);
        }
    }
    protected void cstAuditorReviewDocumentSubmit_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (gvADDocument.Rows.Count <= 0)
        {
            args.IsValid = false;
            cstAuditorReviewDocumentSubmit.ErrorMessage = "Upload review documents.";
            return;
        }
    }
    protected void btnADUpload_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SaveDocument(8, hdnAuditUserID.Value);
        }

    }
    protected void btnIEUpload_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SaveDocument(9, hdnIEUserID.Value);
        }
    }
    protected void cstIEReviewDocumentSubmit_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (gvIEReviewFile.Rows.Count <= 0)
        {
            args.IsValid = false;
            cstIEReviewDocumentSubmit.ErrorMessage = "Upload review documents.";
            return;
        }
    }
    protected void gvIEReviewFile_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lnkButton = (LinkButton)e.Row.FindControl("lnkDelete");

            lnkButton.Attributes.Add("onclick", "javascript:return " + "confirm('Are you sure you want to delete?')");

        }
    }
    protected void gvIEReviewFile_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        if (gvIEReviewFile.Rows.Count != 1)
        {


            long intDocID = (long)gvIEReviewFile.DataKeys[e.RowIndex].Value;
            CandidateAllocateAssessorBAL objCBDBAL = new CandidateAllocateAssessorBAL();
            string strReturnValue = string.Empty;
            strReturnValue = DeleteReviewDocuments(intDocID, 9, Guid.Parse(hdnIEUserID.Value));

            if (strReturnValue == "SUCCESS")
            {
                gvIEReviewFile.DataSource = objCBDBAL.GetAssessorDocument(9, Guid.Parse(hdnIEUserID.Value), Convert.ToInt64(hdnCandidateBriefId.Value));
                gvIEReviewFile.DataBind();
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "alert('Please add another document before deleting this document.');", true);
        }
    }
    protected void mvwCandidateBriefDetails_ActiveViewChanged(object sender, EventArgs e)
    {
        if (mainMenu.Items.Count > 0)
        {
            mainMenu.Items[0].Text = mainMenu.Items[0].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 1)
        {
            mainMenu.Items[1].Text = mainMenu.Items[1].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 2)
        {
            mainMenu.Items[2].Text = mainMenu.Items[2].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 3)
        {
            mainMenu.Items[3].Text = mainMenu.Items[3].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 4)
        {
            mainMenu.Items[4].Text = mainMenu.Items[4].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 5)
        {
            mainMenu.Items[5].Text = mainMenu.Items[5].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 6)
        {
            mainMenu.Items[6].Text = mainMenu.Items[6].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 7)
        {
            mainMenu.Items[7].Text = mainMenu.Items[7].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 8)
        {
            mainMenu.Items[8].Text = mainMenu.Items[8].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 9)
        {
            mainMenu.Items[9].Text = mainMenu.Items[9].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 10)
        {
            mainMenu.Items[10].Text = mainMenu.Items[10].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 11)
        {
            mainMenu.Items[11].Text = mainMenu.Items[11].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 12)
        {
            mainMenu.Items[12].Text = mainMenu.Items[12].Text.RemoveHTMLTags();
        }
        if (mainMenu.Items.Count > 13)
        {
            mainMenu.Items[13].Text = mainMenu.Items[13].Text.RemoveHTMLTags();
        }
        switch (mvwCandidateBriefDetails.ActiveViewIndex)
        {
            case 0:
                if (mainMenu.Items.Count > 0)
                {
                    mainMenu.Items[0].Text = "<b><font color='blue'>" + mainMenu.Items[0].Text + "</font></b>";
                }
                break;
            case 1:
                if (mainMenu.Items.Count > 1)
                {
                    mainMenu.Items[1].Text = "<b><font color='blue'>" + mainMenu.Items[1].Text + "</font></b>";
                }
                break;
            case 2:
                if (mainMenu.Items.Count > 2)
                {
                    mainMenu.Items[2].Text = "<b><font color='blue'>" + mainMenu.Items[2].Text + "</font></b>";
                }
                break;
            case 3:
                if (mainMenu.Items.Count > 3)
                {
                    mainMenu.Items[3].Text = "<b><font color='blue'>" + mainMenu.Items[3].Text + "</font></b>";
                }
                break;
            case 4:
                if (mainMenu.Items.Count > 4)
                {
                    mainMenu.Items[4].Text = "<b><font color='blue'>" + mainMenu.Items[4].Text + "</font></b>";
                }
                break;
            case 5:
                if (mainMenu.Items.Count > 5)
                {
                    mainMenu.Items[5].Text = "<b><font color='blue'>" + mainMenu.Items[5].Text + "</font></b>";
                }
                break;
            case 6:
                if (mainMenu.Items.Count > 6)
                {
                    mainMenu.Items[6].Text = "<b><font color='blue'>" + mainMenu.Items[6].Text + "</font></b>";
                }
                break;
            case 7:
                if (mainMenu.Items.Count > 7)
                {
                    mainMenu.Items[7].Text = "<b><font color='blue'>" + mainMenu.Items[7].Text + "</font></b>";
                }
                break;
            case 8:
                if (mainMenu.Items.Count > 8)
                {
                    mainMenu.Items[8].Text = "<b><font color='blue'>" + mainMenu.Items[8].Text + "</font></b>";
                }
                break;

            case 9:
                if (mainMenu.Items.Count > 9)
                {
                    mainMenu.Items[9].Text = "<b><font color='blue'>" + mainMenu.Items[9].Text + "</font></b>";
                }
                break;
            case 10:
                if (mainMenu.Items.Count > 10)
                {
                    mainMenu.Items[10].Text = "<b><font color='blue'>" + mainMenu.Items[10].Text + "</font></b>";
                }
                break;
            case 11:
                if (mainMenu.Items.Count > 11)
                {
                    mainMenu.Items[11].Text = "<b><font color='blue'>" + mainMenu.Items[11].Text + "</font></b>";
                }
                break;
            case 12:
                if (mainMenu.Items.Count > 12)
                {
                    mainMenu.Items[12].Text = "<b><font color='blue'>" + mainMenu.Items[12].Text + "</font></b>";
                }
                break;
            case 13:
                if (mainMenu.Items.Count > 13)
                {
                    mainMenu.Items[13].Text = "<b><font color='blue'>" + mainMenu.Items[13].Text + "</font></b>";
                }
                break;
        }
    }
}


